58
loading...
This website collects cookies to deliver better user experience
settings.py
file....
DATABASES['default']['ENGINE'] = 'django.contrib.gis.db.backends.postgis'
# Heroku: Update database configuration from $DATABASE_URL.
import dj_database_url
db_from_env = dj_database_url.config(conn_max_age=500)
DATABASES['default'].update(db_from_env)
AttributeError: 'DatabaseOperations' object has no attribute 'geo_db_type'
heroku/python
official buildpack. However, since our application needs more than just a python
runtime environment — our application needs GDAL
, GEOS
, and PROJ
in addition to a python runtime environment — we must get the additional environment in place for our application to compile. There are various buildpacks out there for this, however Heroku Buildpack Geo worked seemlessly. GIS
related projects therefore, it cannot be used alone. You still need a python runtime environment for your applications to run.heroku create application_name
— follow the steps below:Set the official python buildpack:
heroku buildpacks:set heroku/python
Insert the custom heroku-geo-buildpack
:
heroku buildpacks:add --index 1 https://github.com/heroku/heroku-geo-buildpack.git
This will insert the heroku-geo-buildpack
buildpack at the first position in the order of buildpack execution, and move the other buildpacks that are ahead of it down one position.4
heroku-geo-buildpack
buildpack comes first! It installs the basic requirements of a GIS
application.heroku buildpacks
GeoDjango Tutorial - by Official Django Docs ↩
Make a Location-Based Web App With Django and GeoDjango - by Ahmed Bouchefra ↩
Django Tutorial Part 11: Deploying Django to production - by MDN ↩
Using Multiple Buildpacks for an App - by Heroku ↩