I'm trying to use GeoDjango + gdal + PostGis in order to create a map application.
OSGeo4W is completelly installed, and all the dll files are there
When I run this command:
python3 manage.py check
I get the following result:
^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: Could not find module 'C:\OSGeo4W\bin\gdal308.dll' (or one of its dependencies). Try using the full path with constructor syntax.
However the files are correctly existing in the location. Here is how my settings file looks like, for the gdal part:
if os.name == 'nt':
OSGEO4W = r"C:\\OSGeo4W"
# if '64' in platform.architecture()[0]:
# OSGEO4W += "64"
assert os.path.isdir(OSGEO4W), "Directory does not exist: " + OSGEO4W
os.environ['OSGEO4W_ROOT'] = OSGEO4W
os.environ['GDAL_DATA'] = OSGEO4W + r"\\share\\gdal"
os.environ['PROJ_LIB'] = OSGEO4W + r"\\share\\proj"
os.environ['PATH'] = OSGEO4W + r"\\bin;" + os.environ['PATH']
GDAL_LIBRARY_PATH = OSGEO4W + r"\\bin\\gdal308.dll"
Could someone who has gone through this please help me shed some light over it?
You are to "new". GeoDjango only supports GDAL up to v.3.7.
Read the documentation: Django DOCs - Installing Geospatial libraries