Installing GeoDjango dependencies on Windows 10 or Windows Server 2012 R2?

I do not see a direct question here and I am little late in answering this. Yet, I have had a hard time setting up a similar environment recently and could not find a simple solution that did not involve hacking source files... So, here is what worked for me:

  1. Install Python 3.6 (32 bit)
  2. Create a virtual environment and activate it
  3. pip install django
  4. pip install psycopg2 (assuming you've setup PostgreSQL)
  5. pip install GDAL-2.2.3-cp36-cp36m-win32.whl You can get that .whl here. Take note of the warning there "Do not use together with OSGeo4W or gdalwin32".
  6. add 2 system environment variables "GDAL_DATA" and "GDAL_LIB".

    • GDAL_DATA = C:\<path_to_your>\venv\Lib\site-packages\osgeo\data\gdal
    • GDAL_LIB = C:\<path_to_your>\venv\Lib\site-packages\osgeo
  7. Then, add each variable to your system PATH like so: %GDAL_DATA% %GDAL_LIB%

  8. Restart Pycharm and Fire up the django server

This basically follows the Django docs but uses the .whl instead of OsGeo4W. Also, I did not mess with the Python path because I have ArcGIS running with Python 2.7