Giter VIP home page Giter VIP logo

nepalmap_federal's Introduction

Nepal Map

The Nepal instance of Wazimap, a Django application for exploring census and other similar data.

Local development

  1. clone the repo
  2. cd nepalmap
  3. mkvirtualenv nepalmap
  4. workon nepalmap
  5. pip install -r requirements.txt

You might need to install certain dependencies on Ubuntu before you can install dependencies via pip for the app.

  • sudo apt install -y libgdal-dev postgresql-server-dev-9.5
  • export C_INCLUDE_PATH=/usr/include/gdal
  • export CPLUS_INCLUDE_PATH=/usr/include/gdal

You will need a Postgres database:

psql -U postgres
create user wazimap_np with password 'wazimap_np';
create database wazimap_np;
grant all privileges on database wazimap_np to wazimap_np;

Import the sql files needed for SimpleTable entries:

cat sql/simpletables/*.sql | psql -U wazimap_np -W wazimap_np

Run migrations to keep Django happy:

python manage.py migrate

Import data for all the tables:

cat sql/*.sql | psql -U wazimap_np -W wazimap_np

Start the server:

python manage.py runserver

Docker based setup

Using this setup, one can run the project inside docker containers. This make the environments lightweight, reproducible and portable.

Requirements

Only the following things are required on your host machine. Nothing else needs to be installed.

  • GNU Make ( Version 4.0 and up )
  • Docker Engine ( Version 17.06 and hopefully upwards )
  • Docker Compose ( Version 1.14 and hopefully upwards )

Development environment

All commands are provided as make targets via Makefile. One can use docker and docker-compose directly for running the services, but some helpers are provided for consistency.

An application environment context (dev, stage, prod) has to be set along with any of the make ... commands. You can either export this in your shell environment, or pass it as an argument to the make target.

# Get all the Makefile documentation
APP_ENV=dev make help

Staging and Production environment (stage and prod)

This is very much similar to running the dev environment. Caddy is used instead of Nginx, because of it's automatic HTTPS certs and other easier-to-configure things. Some commands are added, else much of them are the same as above, expect for the APP_ENV context set to correct environment.

# Run in staging
APP_ENV=stage make ...

# Run in production
APP_ENV=prod make ...

NOTE: Check the comments in compose.<env>.yml before running them.

License

NepalMap code is licensed under the MIT License.

nepalmap_federal's People

Contributors

cliftonmcintosh avatar ravinepal avatar openrijal avatar crispg72 avatar suvash avatar prashishh avatar bezzy1999 avatar ferranmarin avatar techgaun avatar luizfelipetx avatar amitness avatar nikhilgupta23 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.