【发布时间】:2016-10-21 20:03:29
【问题描述】:
我在 heroku 上部署我的 GeoDjango 应用程序时遇到了麻烦(使用 Free Dyno,但我可以在必要时进行更改)。当我执行push heroku master --force 时出现以下错误:
Try using 'django.db.backends.XXX', where XXX is one of:
'mysql', 'oracle', 'postgresql', 'sqlite3'
Error was: cannot import name 'GDALRaster'
我已经安装了 postgis:
$ heroku pg:psql
create extension postgis;
已配置的构建包:
heroku config:add BUILDPACK_URL=https://github.com/ddollar/heroku-buildpack-multi.git
Created .buildpacks file at my project with this links:
https://github.com/cyberdelia/heroku-geo-buildpack.git#1.1
https://github.com/heroku/heroku-buildpack-python.git#v29
Updated Procfile:
web: python manage.py collectstatic --noinput; gunicorn projectname.wsgi
我的 settings.py 已配置:
INSTALLED_APPS = [
....
'django.contrib.gis',
]
default_dburl = 'sqlite:///' + os.path.join(BASE_DIR, 'db.sqlite3')
DATABASES = {
'default': config('DATABASE_URL', default=default_dburl, cast=dburl),
}
DATABASES['default']['ENGINE'] = config('DB_ENGINE')
我的 DB_ENGINE 位于 .env 文件中:
DB_ENGINE=django.contrib.gis.db.backends.postgis
我已经阅读过的参考文献:
我想不出解决办法,
提前感谢您的帮助。
【问题讨论】:
标签: django heroku deployment geodjango