Create a new venv environment:
python -m venv .venv
Activate venv environment (sets you environment so that it uses that specific python interpreter).
Do this anytime you run any command in this project
source .venv/bin/activate
Install required packages (after setting environment in the previous step):
pip install -r requirements.txt
Create database:
python manage.py migrate
Populate database with NECESSARY DATA (drivers, teams, races ... )
NOTE: If you need to reset database, run remove_all_from_database
first. Be careful with that one.
python manage.py populate_database
Populate database with REAL RESULT data:
python manage.py populate_db_real_results
Populate database with REAL BETS data:
python manage.py populate_db_real_bets
Calculate SCORES:
python manage.py assign_scores
Activate the virtual environment:
source .venv/bin/activate
Run the server:
python manage.py runserver
A message should appear: Starting development server at http://127.0.0.1:8000/
Go to that localhost address
- DB used - db.sqlite3 for development, postgresql in production
- If you want to wipe the database
Remove all data about drivers, bets, races etc. from database.
python manage.py remove_all_from_database
- To populate database with test RESULTS, run
python manage.py populate_db_test_results