- Python 3.8
- Setup virtual environment
- Install Python dependencies
# for production
pip install -r requirements-prod.txt
# for development & testing
pip install -r requirements.txt
- copy and configure env variables to match your setup
# using .env file
cp .env.example .env
- Run migration and load initial data
python manage.py migrate
python manage.py loaddata --app apps.geolocation geo_locations_id.json
- Run local server
python manage.py runserver
- (Production) Run server with gunicorn
python -m gunicorn mitraauto.asgi:application -k uvicorn.workers.UvicornWorker
- Run test
APP_ENV=testing manage.py test
# using Makefile
make test
- Run test with coverage
APP_ENV=testing coverage run manage.py test
# using Makefile
make coverage
- Generate coverage output as HTML
coverage html