# 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):
```sql
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](https://docs.djangoproject.com/en/5.2/topics/db/queries) 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):

```py
# Example printing equivalent SQL query
q = Group.objects.filter(group2type__type__name="Windrow", child_group__parent_id=1)
print(q.query)
```
