Skip to content Skip to sidebar Skip to footer

Running Postgis With Django On Heroku

Trying to run a GeoDjango app on Heroku and it's being a really piece of work. After struggling through a variety of problems, I've come to one I can't seem to hack my way out of.

Solution 1:

Geodjango need to connect "postgis://..." but heroku change db settings to "postgres://". So, if you move DATABASES variable to bottom in settings.py, problem has been resolved. Happy hacking :)

django_heroku.settings(locals())

DATABASES = {
    'default': {
        'ENGINE': 'django.contrib.gis.db.backends.postgis',
        'NAME': '*',
        'USER': '*',
        'PASSWORD': '*',
        'HOST': '*',
        'PORT': '5432',
    },
}

Post a Comment for "Running Postgis With Django On Heroku"