Getting ‘DatabaseOperations’ object has no attribute ‘geo_db_type’ error when doing a syncdb

The OP was using the GeoDjango buildpack, but in case anyone gets here using Geo buildpack and dj_database_url like I was, in settings.py don’t forget the last line:

import dj_database_url
DATABASES['default'] = dj_database_url.config()
DATABASES['default']['ENGINE'] = 'django.contrib.gis.db.backends.postgis'

UPDATE

dj_database_url directly supports PostGIS. You can do without the last line in the code above if you can change your database URL to start with postgis.

Leave a Comment