Tracking Covid Cases
- Django 3
- Django Rest Framework
- PostgreSQL
- Create a virtualenv and activate it:
virtualenv -p python3.8 venv
source venv/bin/activate
- Install development requirements:
pip install -r requirements/local.txt
- Create a new PostgreSQL database using createdb:
createdb <database name> -U postgres --password <password>
- 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
- Apply migrations:
python manage.py migrate
- Run the server:
python manage.py runserver 0.0.0.0:8000
- Git commands
git init
pre-commit install
You should have Docker and Docker Compose installed in your system.
docker-compose -f local.yml build
docker-compose -f local.yml up
docker-compose up
docker-compose -f local.yml run --rm django python manage.py migrate
docker-compose -f local.yml run --rm django python manage.py createsuperuser
- 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