This API uses the Argentinian Ministry of Health (msal.gob.ar) dataset
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.gitCreate 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 productionImportant: Once you copy the env file change the secret key for a random string
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 addTo force the update
python manage.py update_dataNote: This may take up to an hour to update.
Important: Always make sure you have the env activated before running any command.
Make sure the port 8000 is not being used.
python manage.py runserverMake sure the port 8000 is not being used.
gunicorn covid_api.wsgi --workers 3 --timeout 600 --bind 0.0.0.0:8000 -D# Access swagger
http://localhost:8000/api/v1/swagger/