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

前端 未结 9 1975
有刺的猬
有刺的猬 2020-12-01 08:43

I\'m attempting to run heroku run python manage.py syncdb on my GeoDjango app on Heroku, but I get the following error:

AttributeError: \'Databa

9条回答
  •  猫巷女王i
    2020-12-01 09:32

    I'm using the Python sample application on stack cedar 14 and the regular Heroko buildpack heroku/python with PostGIS and had the same problem that my database settings were overwritten with the wrong DB engine, which caused heroku run python manage.py migrate to fail with above error. Just adding the engine in the settings would not change anything. After some investigation I found out that it is the call to django_heroku.settings(locals()) in the last line if my settings.py which is reverting my changes.

    I fixed it by overwriting the engine again like this by adding a line afterwards:

    django_heroku.settings(locals())
    DATABASES['default']['ENGINE'] = 'django.contrib.gis.db.backends.postgis'
    

提交回复
热议问题