【发布时间】:2015-03-19 21:52:16
【问题描述】:
数据库的设置是:
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.sqlite3', # Add 'postgresql_psycopg2', 'mysql', 'sqlite3' or 'oracle'.
'NAME': 'dataBase', # Or path to database file if using sqlite3.
# The following settings are not used with sqlite3:
'USER': 'dataBase',
'PASSWORD': '',
'HOST': '', # Empty for localhost through domain sockets or '127.0.0.1' for localhost through TCP.
'PORT': '', # Set to empty string for default.
}
}
并产生异常:
django.core.exceptions.ImproperlyConfigured: 'django.contrib.gis.db.backends.sqlite3' isn't an available database backend.
Try using 'django.db.backends.XXX', where XXX is one of:
u'mysql', u'oracle', u'postgresql_psycopg2', u'sqlite3'
Error was: No module named sqlite3.base
遵循 django 文档https://docs.djangoproject.com/en/1.7/ref/contrib/gis/tutorial/
【问题讨论】:
-
看起来你正在尝试做 GIS 的事情 - 除了 Postgres 之外,我不知道有任何数据库提供一些 GIS 功能。
-
你安装配置好了SpatiaLite吗?