Skip to content

tyrozz/covid19-tracker

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

covidtracker

Tracking Covid Cases

Code style: black License: MIT

Requirements

  • Django 3
  • Django Rest Framework
  • PostgreSQL

Getting Up and Running Locally

  1. Create a virtualenv and activate it:
virtualenv -p  python3.8 venv
source venv/bin/activate
  1. Install development requirements:
pip install -r requirements/local.txt
  1. Create a new PostgreSQL database using createdb:
createdb <database name> -U postgres --password <password>
  1. Set the environment variables:
export DATABASE_URL=postgres://postgres:<password>@127.0.0.1:5432/<DB name given to createdb>

export CELERY_BROKER_URL=redis://localhost:6379/0

export USE_DOCKER=no
  1. Apply migrations:
python manage.py migrate
  1. Run the server:
python manage.py runserver 0.0.0.0:8000
  1. Git commands
git init
pre-commit install

Getting Up and Running Locally With Docker

You should have Docker and Docker Compose installed in your system.

To build the stack

docker-compose -f local.yml build

To run the stack

docker-compose -f local.yml up

docker-compose up

To execute Django commands

docker-compose -f local.yml run --rm django python manage.py migrate

docker-compose -f local.yml run --rm django python manage.py createsuperuser

Field Description

Location

  • location_code: Unique code for each row entry. For example Brussels-Belgium: 5602, East Flanders-Belgium: 5603
  • country_code: Unique code for each country For example Belgium: 56
  • iso2 and iso3: Country code identifiers
  • fibs: Federal Information Processing Standards code, USA only.
  • province_state: Province/State
  • country_region: Country/Region
  • location_name: Country name and the location name together. For example Antwerp, Belgium
  • slug: Unique slug for each location. Generated with location_name if it is not provided.
  • country_population
  • latitude
  • longitute