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

前端 未结 9 1903
有刺的猬
有刺的猬 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条回答
  • 2020-12-01 09:40

    This post is old but I just wanted to share my answer to this problem. I'm using the Dj Database package, and I didn't know that the connection URL is different when using PostGIS. The connection string for PostGIS is postgis://USER:PASSWORD@HOST:PORT/NAME

    Hope this helps someone.

    0 讨论(0)
  • 2020-12-01 09:42

    I was having the same problem and I had to change:

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

    to:

    'ENGINE': 'django.contrib.gis.db.backends.postgis',
    
    0 讨论(0)
  • 2020-12-01 09:42

    for me helped

    1) add 'django.contrib.gis', to INSTALLED_APPS
    2) change from

    DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.mysql',
    

    to

    DATABASES = {
    'default': {
        'ENGINE': 'django.contrib.gis.db.backends.mysql', 
    
    0 讨论(0)
提交回复
热议问题