2013-10-07 11 views
6

Sono nuovo di geodjango. Sto usando le mie impostazioni del database django-1.4.5 e,L'oggetto 'module' non ha attributo 'GeoSQLCompiler'

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. 
    } 
} 

ed ho ottenuto l'errore 'module' object has no attribute 'GeoSQLCompiler' Si prega di risolvere il mio problema.

+0

avete 'django.contrib.gis' nel vostro' INSTALLED_APPS'? – karthikr

+0

sì karthikr Ho aggiunto il django.contrib.gis nella mia app – dhana

risposta

20

Sostituire:

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

con

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

Ho risolto il mio problema. Ma hai dato la risposta giusta. Accetterò la tua risposta. – dhana

Problemi correlati