Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

heroku PostGIS syncdb error

I am having trouble getting a simple GeoDjango app running on heroku. I have created the postgis extension for my database but I am not able to run syncdb without getting the following error:

from django.contrib.gis.geometry.backend import Geometry
File "/app/.heroku/python/lib/python2.7/site-packages/django/contrib/gis/geometry/backend/__init__.py", line 14, in <module>
'"%s".' % geom_backend)
django.core.exceptions.ImproperlyConfigured: Could not import user-defined GEOMETRY_BACKEND "geos".

Any ideas what I am doing wrong? Also does anyone know of a tutorial for getting a simple geodjango project running on heroku? Thanks for your help

like image 561
Jeff Ames Avatar asked May 28 '13 02:05

Jeff Ames


1 Answers

I ran into this same issue and Joe is correct, you are missing a buildpack. What I did differently was include both the heroku-geo-buildpack and the heroku-buildpack-python. Both can be included by using the heroku-buildpack-multi and adding a ".buildpacks" file to your home directory in which to include the other buildpacks.

https://github.com/ddollar/heroku-buildpack-multi

So set buildpack-multi as your buildpack and add a .buildpacks file in your project base directory:

$ heroku config:set BUILDPACK_URL=https://github.com/ddollar/heroku-buildpack-multi.git
$ touch .buildpacks

# .buildpacks
https://github.com/cyberdelia/heroku-geo-buildpack.git#1.0
https://github.com/heroku/heroku-buildpack-python

When you push this, Heroku will install the software packages required to run python (python, pip, etc), along with the software packages required to run postgis (geos, proj and gdal).

I gave heroku-buildpack-geodjango a try but I believe it might be out of date (hasn't been updated in a year).

like image 121
Jeff Miller Avatar answered Nov 15 '22 04:11

Jeff Miller