May 15

Using Django with Spatialite on Debian

Screen Shot 2015-05-19 at 15.21.41

SpatiaLite is a library for extending SQLite core for efficient Spatial functions. I am currently using it, during research. It’s a bit cumbersome to install it with Django 1.8. After hours of struggling, I finally installed it on my Debian system.

In order to not waste some much hours, I wrote whole process to this gist.(64 lines)

But I want to write some of gotchas here:

  • Before starting make sure you have installed build-essential.
  • Make sure you also installed python2.7-dev package, this is required for packages that uses Python.h
  • + don’t forget to install libexpat1, libexpat1-dev, both required for compiling spatialise-tools.
  • There is a slight difference with paths during the compilation. Some of the libraries tend to look only to usr/lib, usr/includebut others just only check usr/local/bin, /usr/local/include.
  • On my local system (Mac OS X), after following steps from Django’s Docs on Spatialite, I added this to my settings.py