- Install python3 and docker
- Install python3 dependencies in one go from root folder :
cd ./api && pip3 install --no-cache-dir -r requirements.txt
Numpy (pip install numpy)
Pandas (pip install pandas)
Django (pip install django)
Django rest framework (pip install djangorestframework)
Django pandas (pip install django_pandas)
Django rest multiple models (pip install django-rest-multiple-models)
psycopg2 (pip install psycopg2)
Shapely (pip install Shapely)
Geopandas (some of it’s pre-requirements) (pip install geopandas)
There may arise some problems\errors while installing geopandas, check if versions match the ones in ./api/reqirements.txt
In this case download the latest, compatible GDAL .whl file (Ex. if your OS is windows 64 bit, and if your python version is 3.6, download GDAL-3.0.4-cp36-cp36m-win_amd64.whl) from this website: https://www.lfd.uci.edu/~gohlke/pythonlibs/#gdal
Run :
pip install /path/to/GDAL-***.whl
Repeat the above steps for Fiona:
https://www.lfd.uci.edu/~gohlke/pythonlibs/#fiona
Now Run:
pip install geopandas
Install in one go : cd ./containers/postgres && ./start_postgres.sh
Perequisites: Should have docker installed in the system, should know/set the db password
Manual Installation (In case docker install fails, or you want to view the database using PgAdmin GUI )
Download the package from this website: https://www.postgresql.org/download/
Click on the download the installer and click on the latest version for your OS to download.
Run the installer. Select all the packages to be installed.
While the installer runs it asks for a password setup for the superuser: postgres
Default we are using spotcorona
. Do not use this in a production environment
Complete the installation
Open pgAdmin from start menu.
Once it opens in the web browser, Authorize with your password.
In the browser panel on the left, right click on Databases and create a new database with the name: corona_project.
You would not see any tables yet because they havent been populated from the django project.
Export the password using export DB_PASSWORD=your_password
for the next step.
Install in one go : cd ./containers/server && ./start_server.sh
- If hosting, ssh into your machine, eg
ssh -i covidkey.pem [email protected]
and git clone https://github.com/GoCorona-org/Backend.git. Else skip this step. - In Command terminal
- Go to the directory $ ./api
- To make the server avaliable globally add your public IP to the ALLOWED_HOSTS field in ./api/corona_project/settings.py
- Run:
python manage.py makemigrations corona_app
- Run:
python manage.py sqlmigrate corona_app 0001_initial
- Run:
python manage.py migrate
After this you can check the corona_project database/schemas/tables in the pgAdmin if installed. Right click and refresh. you can see the corona_app_coronaapp and corona_app_medicalmap tables - Run:
python manage.py runserver
- Open http://127.0.0.1:8000/report in your browser
The reference doc for the Backend API is https://github.com/GoCorona-org/Backend/blob/master/docs/swagger.yaml ( swagger.yaml in docs folder)
Copy paste the yaml files into https://editor.swagger.io/ to view the api.
- Refactored the folders
- Moved gocorona_api (@wadkar's folder) to experimental, until code maturity.
- Moved intersection and medical folders to experimental, to be deprecated in the next release.
- Added helpful bash scripts and readmes in order to get started faster.