0

For testing purposes I'm trying to use SQLite, but it seems I'm missing the spatialite backend:

django.core.exceptions.ImproperlyConfigured: 'django.contrib.gis.backends.spatialite' isn't an available database backend.
Try using django.db.backends.XXX, where XXX is one of:
    'dummy', 'mysql', 'oracle', 'postgresql_psycopg2', 'sqlite3'
Error was: No module named backends.spatialite.base

Any idea how I can make Django find it?

I have installed spatialite.

This is my db setup:

DATABASES['default'] = {
    'ENGINE': 'django.contrib.gis.backends.spatialite',
    'NAME': '/tmp/test.db'
}

Ubuntu 12.04.1 LTS; Python 2.7.3; Django 1.4.1

webjay
  • 5,358
  • 9
  • 45
  • 62

1 Answers1

2

You should look for:

django.contrib.gis.db.backends.spatialite

not

django.contrib.gis.backends.spatialite

:)

trying importing from shell

Duda Nogueira
  • 317
  • 2
  • 6
  • 1
    great, that seems to work; next problem is `The pysqlite library does not support C extension loading. Both SQLite and pysqlite must be configured to allow the loading of extensions to use SpatiaLite.` which I guess means that I need to manually compile pysqlite. – webjay Jan 17 '13 at 16:53
  • 1
    fixed, here's how: http://technotes.tumblr.com/post/40838871308/django-with-sqlite-as-a-geospatial-database – webjay Jan 18 '13 at 13:35