This is the simple project for GeoDjango app. In this app, user can add the location from django-admin and the location name will be available in home page.
git clone https://github.com/iamtekson/geodjango-app.git
cd geodjango-app
Make sure to change the database connection parameters from geoProject/settings.py
file,
DATABASES = {
'default': {
'ENGINE': 'django.contrib.gis.db.backends.postgis',
'NAME': 'geoapp',
'USER': 'postgres',
'PASSWORD': 'admin',
'HOST': 'localhost',
'PORT': '5432',
}
}
In windows the gdal can be installed by following method;
# Gdal installations
pip install pipwin
pipwin refresh
pipwin install gdal
In Ubuntu, the gdal can be installed by following method;
sudo apt install -y gdal-bin libgdal-dev libgeos-dev libproj-dev
pip install pygdal=="`gdal-config --version`.*"
Now you can install the other dependencies as mentioned in requirements.txt
# Other dependencies
pip install -r requirements.txt
python manage.py makemigrations
python manage.py migrate
python manage.py collectstatic
Create the django superuser
python manage.py createsuperuser
Now you can run the django server using following command,
python manage.py runserver
Now your site will be running in this url: http://localhost:8000/
For the deployment of this web-GIS you can check this blog in dev.to Web-GIS Deployment in Ubuntu server (Nginx + Tomcat + PostGIS)