Skip to content

alavarello/covid-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Argentine COVID-19 API

This API uses the Argentinian Ministry of Health (msal.gob.ar) dataset

Installation

Clone the repository using ssh or http

# Clone repo using ssh
git clone git@github.com:alavarello/covid-api.git
# Clone repo using http
git clone https://github.com/alavarello/covid-api.git

Create the virtual environment and install all the requirements.
For more information about virtual environments click here
The global python version must be > 3.6

# Create a virtual environment
python -m venv env
# Activate
source env/bin/activate  # On Windows use `env\Scripts\activate`

# Install Django and Django REST framework into the virtual environment
pip install -r requirements.txt

# Run migrations
python manage.py migrate

# Create .env file
cp docs/env.txt covid_api/.env  # In development
cp docs/env_production.txt covid_api/.env # In production

Important: Once you copy the env file change the secret key for a random string

Update data

Important: Always make sure you have the env activated before running any command.

To add the cron that updates the data.

python manage.py crontab add

To force the update

python manage.py update_data

Note: This may take up to an hour to update.

Run

Important: Always make sure you have the env activated before running any command.

Development

Make sure the port 8000 is not being used.

python manage.py runserver

Production

Make sure the port 8000 is not being used.

gunicorn covid_api.wsgi --workers 3 --timeout 600 --bind 0.0.0.0:8000 -D

Docs

# Access swagger
http://localhost:8000/api/v1/swagger/

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published