I'm facing this error when setting up geodjango in a working django 1.9 app.
My app is living inside a amazon EC2 instance plus a RDS postgres instance.
The error is:
django.core.exceptions.ImproperlyConfigured: 'django.contrib.gis.db.backends.postgis' isn't an available database backend.
Try using 'django.db.backends.XXX', where XXX is one of:
'mysql', 'oracle', 'postgresql', 'sqlite3
What I've done:
Modify my project settings.py to include:
Modify my app models.py to import models from django.contrib.gis.db, instead of django.db
Any guess what I'm missing?
I had the same issue i installed the osgeo and then navigated to the missing libraries
> # Build paths inside the project like this: os.path.join(BASE_DIR, ...) BASE_DIR =
> os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
> TEMPLATE_DIR=os.path.join(BASE_DIR,'templates')
and these were the missing libraries for me:
GDAL_LIBRARY_PATH = r'C:\OSGeo4W64\bin\gdal204.dll'
GEOS_LIBRARY_PATH=r'C:\OSGeo4W64\bin\geos_c.dll'
I had the same issue. I ran pip install gdal
, which showed error messages about a libffi library missing on my system. After installing the correct library (libffi6 on AUR
), I ran pip install gdal
again and the issue was resolved.
Run this command
sudo apt-get install binutils libproj-dev gdal-bin
This is described in this documentation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With