2
votes

I am running my django app on heroku. I want to use their websolr plugin to add spatial search to the app via django haystack.

Spatial serach in django haystack depends on the GEOS C library that is not deployed on heroku by default.

So in order to use spatial search I followed https://devcenter.heroku.com/articles/buildpack-binaries to create a binary package of GEOS.

To deploy the binaries I forked the heroku buildback for python and modified bin/compile to include:

AWESOME_VM_BINARY="http://vulcan-dtornow.herokuapp.com/output/05391114-f314-4aa7-9aab-bc09025d4898"

mkdir -p /app/.heroku/vendor/geos
curl $AWESOME_VM_BINARY -o - | tar -xz -C /app/.heroku/vendor/geos -f -

I added the custom build pack to my application, redeployed but still I cannot access the library. When I run ls the geos folder does not show up

heroku run ls /app/.heroku/vendor

Any idea what I am missing? Thanks for your help!

2
If anyone is still looking for a working buildpack for python/geos or geodjango. Check this out goodcode.io/articles/django-heroku-gdal-problem - kophygiddie

2 Answers

1
votes

Another option is using a buildpack that only contains the geospatial libraries and combine it with the python buildpack. This is a cleaner separation:

https://github.com/cyberdelia/heroku-geo-buildpack/

in combination with

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

To use it add a .buildpacks file to your repo that looks something like this

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

(the use of multi buildpacks is explained in the multi buildpack repo as well)

0
votes

You should be able to use the GeoDjango buildpack that was already created here