AttributeError: 'DatabaseOperations' object has no attribute 'geo_db_type'

3,615 views
Skip to first unread message

Visgean Skeloru

unread,
Aug 21, 2012, 6:26:34 PM8/21/12
to geod...@googlegroups.com
Hi, I am new to geodjango,

my setting look like this:


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



INSTALLED_APPS = (
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.sites',
    'django.contrib.messages',
    'django.contrib.staticfiles',
    'django.contrib.gis',
    'django.contrib.admin',
    'django.contrib.admindocs',
    'django.contrib.gis',
    "app.core",
   
)


and I have a model like this:

class Location(models.Model):
    author = models.ForeignKey(UserProfile)
    loc = geomodels.PointField()
   
    objects = geomodels.GeoManager()


But the problem is that it wont syncdb:

AttributeError: 'DatabaseOperations' object has no attribute 'geo_db_type'

But if I remove the model from installed_apps everything is which is weird because there is also "django.contrib.gis" but that seems to be ok..

the db was created using command:

postgres@rewitaqia:~$ createdb -U postgres -T template_postgis -O django db_name


Please could you help me?

Victor Rocha

unread,
Aug 22, 2012, 12:05:39 AM8/22/12
to geod...@googlegroups.com
Your database engine setting is wrong:
it should be:
'ENGINE': 'django.contrib.gis.db.backends.postgis'



--
You received this message because you are subscribed to the Google Groups "geodjango" group.
To view this discussion on the web visit https://groups.google.com/d/msg/geodjango/-/TxS4YUCrx1cJ.
To post to this group, send email to geod...@googlegroups.com.
To unsubscribe from this group, send email to geodjango+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/geodjango?hl=en.

Reply all
Reply to author
Forward
0 new messages