GithubHelp home page GithubHelp logo

fagan2888 / healthsites Goto Github PK

View Code? Open in Web Editor NEW

This project forked from healthsites/healthsites

0.0 1.0 0.0 80.36 MB

Building an open data commons of health facility data with OpenStreetMap

Home Page: https://healthsites.io/

License: Other

Python 40.31% CSS 4.97% JavaScript 29.63% Shell 0.24% HTML 12.29% Dockerfile 0.24% Makefile 1.10% PLpgSQL 0.05% PLSQL 11.18%

healthsites's Introduction

Welcome to the healthsites code base!

Join the chat at https://gitter.im/healthsites/healthsites

Healthsites is a framework for capturing, publishing and sharing critical health and sanitation related data to help make these facilities more accessible and relevant to the communities they serve. Our framework does not limit our endeavours to these domains and in the future we plan to support additional domains where it is helpful in humanitarian work.

Please note that this project is in the early phase of its development.

You can visit a running instance of healthsites at healthsites.io.

Status

These badges reflect the current status of our development branch:

Tests status: Build Status

Coverage status: Coverage Status

Development status: Stories in Ready Stories in Ready

License

Data: Open Database License Code: Free BSD License

Our intention is to foster widespread usage of the data and the code that we provide. Please use this code and data in the interests of humanity and not for nefarious purposes.

Setup instructions

The Healthsites infrastructure uses Docker with the Django platform, and has two databases. One is a database for use with Django that contains data for all healthsites, another is for the Docker OpenStreetMap database. Healthsites has a Docker OSM mirror and needs it as main architecture. To setup the server, please follow the instruction.

Check out the source

First checkout out the source tree:

git clone git://github.com/healthsites/healthsites.git

Production setup

To start production setup, follow this steps

cd healthsites/deployment
make deploy

It will run all of architecture automatically. Wait until this error shows:

django.db.utils.ProgrammingError: relation "django_site" does not exist
LINE 1: SELECT (1) AS "a" FROM "django_site" LIMIT 1

This is because database in the docker osm needs to be created. This database is created automatically by container of docker osm To fix it, just wait until the container done on creating database by checking it periodically. To check it

docker logs dockerosm_imposm

and see if it is creating database in logs like this

[Feb 16 09:15:13] [INFO] Imposm took: 1m49.293342244s
Import PBF successful : /home/settings/country.pbf
Installing QGIS styles.
SET
SET
CREATE TABLE
ALTER TABLE
CREATE SEQUENCE

The estimation is about >3 hours for earth data.

After it is done, redo

cd healthsites/deployment
make deploy

and server is ready to be used. Server can be accessed in

http://localhost:49362

Creating admin user

Currently admin can't be accessed because it doesn't had admin user yet. To do it

cd healthsites/deployment
make shell
python manage.py createsuperusr

and fill the instruction shows on the terminal

I have initial database

If we already has initial backups database, we need to restore this database into server. To do it

cd healthsites/deployment
make dbrestore

Healthsites is using cache to fasten the process. To generate this process, some process needs to be done

cd healthsites/deployment
make shell
python manage.py generate_cluster_cache
python manage.py generate_countries_cache

Now, we want to link our data into docker osm data, to do that

cd healthsites/deployment
make shell
python manage.py check_localities_osm_id

This will taking a lot of time because docker osm is quite a big list.

Country data extraction

When we access page per country, there will be button to download shapefile. The generation of shapefile will be done in background for every 24 hours. But if we want to run it manually, we can do

python manage.py generate_shapefile_countries

Development setup

This development setup is just for PyCharm IDE. Please follow this steps.

cd healthsites/deployment
make devweb

After that, open projects at the pycharm. Right click django_project folder and Mark Directory as Source Root

Project settings

Next step is setup our project settings

1. Go to File -> settings
2. Go to Project: Healthsites -> Project Interpreter
3. Click `gear` icon and click `SSH Interpreter`
4. Fill host=localhost, username=root and port=49363
5. Next and fill password=docker
6. Next and change interpter to `/usr/bin/python`
7. Change sync folder with remote folder=healthsite folder/django_project and remote folder=/home/web/django_project
8. and click finish

Django settings

Next step is setup our django settings

1. Go to File -> settings
2. Go to languages & framework -> django
3. enable `Enable django support`
4. Django project root= locate this (<your healthsites folder>/django_project)
5. settings=core/settings/dev_docker.py
6. Click OK

Run configurations

Now project settings is setup, our next step is setup run configuration to run our development server.

1. Go to Run -> Edit Configuration
2. Click + icon and select django server
3. on the right, fill name with anything
4. Host=0.0.0.0
5. Port=8080
6. Python interpreter= Select the one that we create, which has sentences `localhost:49363`
7. Click OK and run!

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.