|
|
||
|---|---|---|
| datavis | ||
| marketing | ||
| roboteyes | ||
| .gitignore | ||
| README.md | ||
| manage.py | ||
| mysql.example.cnf | ||
| pyrightconfig.json | ||
| requirements.txt | ||
README.md
Running Server
python manage.py runserver
Testing
python manage.py test [appname]
- E.g.,
python manage.py test datavis
Populating with test data
Truncate all data: python manage.py flush datavis
Reset database (normal sql client):
DROP DATABASE SouthwestChickenTest;
CREATE DATABASE SouthwestChickenTest;
Then python manage.py init_test_data
Useful debugging for querying
python manage.py shell gives you a shell where you can run queries like Measurements.objects.all() or whatever filtering you'd like. See documentation for reference.
Note: To print the query that django is using (e.g., to compare to a manual query to figure out how to translate something to the django DSL):
# Example printing equivalent SQL query
q = Group.objects.filter(group2type__type__name="Windrow", child_group__parent_id=1)
print(q.query)