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.
These badges reflect the current status of our development branch:
Data: Open Database License Code: Free BSD License
Out intention is to foster wide spread 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.
Healthsites infrastructure is using docker, with django platform and has 2 database. The database are django database for django that contains all healthsites data, and another one is for docker osm database.
Healthsites has docker osm mirror and needs it as main architecture. But all setup are easy to be done.
To setup the server, please follow the instruction.
First checkout out the source tree:
git clone git://github.com/healthsites/healthsites.git
To start production setup, follow this steps
cd healthsites/deployment
make deploy
It will run all of architecture automatically and wait it 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
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
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 gen_cluster_cache 48 46
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.
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_v2
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
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
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
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!