shresthashok550 / geodjango-app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Documentation

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.

Getting start with this project

Download the project
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',
    }
}
Installation of dependencies

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
Run server

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/

Deployment in ubuntu server guide

For the deployment of this web-GIS you can check this blog in dev.to Web-GIS Deployment in Ubuntu server (Nginx + Tomcat + PostGIS)

About


Languages

Language:Python 95.4%Language:HTML 4.6%