Skip to content

JamesMutahi/Routers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Routers

This is a django web app to find registered PSV saccos on relevant routes and their charges

Description

This is a django web app to find registered PSV saccos on relevant routes and their charges

Link to deployed site

None

Table of content

  1. Description
  2. Setup and installations
  3. Production

Setup and installations

Prerequisites

  1. Python
  2. virtualenv
  3. Pip

Technologies used

- Python
- Django
- Postgresql

Clone the Repo and rename it to suit your needs.

https://github.com/JamesMutahi/Routers.git

Initialize git and add the remote repository

git init
git remote add origin <your-repository-url>

Create and activate the virtual environment

python -m virtualenv venv
source venv/bin/activate

Set up GEO libraries

Download osgeo installer on link below:

https://trac.osgeo.org/osgeo4w/

This installs libraries that enable django map rendering

Set up Postresql database

Make sure to install spatial database

On your database query console

CREATE EXTENSION pg_trgm;
CREATE EXTENSION postgis;

Setting up environment variables

Create a .env file and paste the following filling where appropriate:

SECRET_KEY='<SECRET_KEY>'
DEBUG=True
MODE='dev'
DB_NAME='<DB_NAME>'
DB_USER='<DB_USER>'
DB_PASSWORD='<DB_PASSWORD>'
DB_HOST='127.0.0.1'
DB_PORT='<DB_PORT>'

Install dependencies

Install dependencies that will create an environment for the app to run pip install -r requirements.txt

Make and run migrations

python manage.py check
python manage.py makemigrations
python manage.py migrate

Run the app

python manage.py runserver

Open localhost:8000

Production

These constitute setup for production mode.

Change .env configuration file to have

MODE='prod'
DEBUG=False

About

A dive into GeoDjango and PostGIS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published