How to Install and Configure GeoDjango with OSGeo4W and GDAL on Windows 11 | 2024

EBISYS Tech
0

 

Introduction

Prerequisites

Step 1: Install GDAL with OSGeo4W

Step 2: Configure Windows Environment Variables

set OSGEO4W_ROOT=C:\OSGeo4W
set GDAL_DATA=%OSGEO4W_ROOT%\apps\gdal\share\gdal
set PROJ_LIB=%OSGEO4W_ROOT%\share\proj
set PATH=%PATH%;%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%"

Step 3: Install Django and Required Libraries

cd path_to_your_project_directory
venv\Scripts\activate
pip install django
pip install psycopg2

Conclusion

Post a Comment

0Comments
Post a Comment (0)