I want to create a simple GeoDjango app with SpatiaLite database but I have this error at migrate:
django.core.exceptions.ImproperlyConfigured: Unable to load the
SpatiaLite library extensio`.
Here the code :
settings.py
INSTALLED_APPS = [
..................
'django.contrib.gis',
.............
]
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.spatialite',
'NAME': os.path.join(BASE_DIR, 'basetest.sqlite3'),
}
}
Where I went wrong?
Best Answer
You need to install the SQLite spatial extension SpatiaLite:
on Debian-based GNU/Linux distributions (es: Debian, Ubuntu, …):
on macOS using Hoembrew:
You can find complete example of a map with Geodjango and Spatialite in this article: Maps with Django (part 1): GeoDjango, SpatiaLite and Leaflet