'module'对象没有属性'GeoSQLCompiler'

时间:2013-10-07 13:21:02

标签: python django geodjango

我是geodjango的新手。我正在使用django-1.4.5和我的数据库设置,

DATABASES = {
    "default": {
        "ENGINE": "django.db.backends.postgresql_psycopg2", # Add "postgresql_psycopg2", "postgresql", "mysql", "sqlite3" or "oracle".
        "NAME": "mydb",                       # Or path to database file if using sqlite3.
        "USER": "postgres",                             # Not used with sqlite3.
        "PASSWORD": "test",                         # Not used with sqlite3.
        "HOST": "localhost",                             # Set to empty string for localhost. Not used with sqlite3.
        "PORT": "",                             # Set to empty string for default. Not used with sqlite3.
    }
}

我收到错误'module' object has no attribute 'GeoSQLCompiler' 请解决我的问题。

1 个答案:

答案 0 :(得分:20)

替换:

'ENGINE': 'django.db.backends.postgresql_psycopg2'

'ENGINE': 'django.contrib.gis.db.backends.postgis'