[Fixed]-Configuring a Postgresql POSTGIS database

1👍

✅

Installed GDAL from Christopher Gohlke’s site (32 bit GDAL-2.0.3-cp35-cp35m-win32.whl)into the virtual environment.
Download OSGEO4W (32 bit) and install the Express Web option.
Create Environment Variables. Set the environment variables as below:

set PYTHON_ROOT=C:\Python35-32 set GDAL_DATA=C:\Program
Files\PostgreSQL\9.6\gdal-data set PROJ_LIB=C:\Program
Files\PostgreSQL\9.6\share\contrib\postgis\proj set
PATH=%PATH%;%PYTHON_ROOT%;%OSGEO4W_ROOT%\bin reg ADD
“HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment” /v
Path /t REG_EXPAND_SZ /f /d “%PATH%” reg ADD
“HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment” /v
GDAL_DATA /t REG_EXPAND_SZ /f /d “%GDAL_DATA%” reg ADD
“HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Environment” /v
PROJ_LIB /t REG_EXPAND_SZ /f /d “%PROJ_LIB%”

I also set LD_LIBRARY_PATH as C:\Python35-32\myvenv_python3\Lib\site-packages\osgeo.
Then, the database is Improperly configured and cannot import ‘GDALRaster’ went away.From your django project directory, it would be possible to migrate now using: python manage.py migrate

Leave a comment