在Windows上安装GeoDjango会生成错误

时间:2017-03-08 13:40:05

标签: python django installation install geodjango

我正在关注这篇论文

https://docs.djangoproject.com/en/1.10/ref/contrib/gis/install/

但它会输出错误信息:

raise improperlyconfigured(error_msg)
django.core.exceptions.improperlyconfigured:'django.contrib.gis.db.backends.postgis' isn't an available database backend.
try using 'django.db.backends.XXX',where XXX is one of:
'mysql','oracle','postgresql','sqlite3'
error was:cannot import name 'GDALRaster'

我的 settings.py

    INSTALLED_APPS = [
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'django.contrib.gis',
    'world',
]

    DATABASES = {
    'default': {
         'ENGINE': 'django.contrib.gis.db.backends.postgis',
         'NAME': 'testdb',
         'USER': 'postgres',
    },
}
  

python版本3.5
  django 1.10.6
  psycopg2 2.7

安装顺序

  

1.python
  2.postgreSQL
  3.postGIS
  4.psycopg2
  5.OSGeo4W
  6.修改Windows环境
  7.django

请帮助我和thanx。

0 个答案:

没有答案