A (Django) RESTful API providing traffic counts for Devon, South West.
- Python==3.7
- Django==2.2
- djangorestframework==3.9.2
- Set up your Postgres database
- Edit environment details env.ps1 / env.sh to reflect your database settings
- Start the virtualenv with:
-
- $ python -m venv venv
- $ source venv/scripts/activate
- $ source ./env.sh
-
- $ python -m venv venv
- $ venv\scripts\activate
- $ .\env.ps1
- $ pip install -r requirements.txt
- $ django manage.py makemigrations
- $ django manage.py migrate
- Import Devon.csv data into database by running 'python import_csv.py'
- Run 'python manage.py runserver' and check that the data succesfully imported by visiting http://127.0.0.1:8000
https://citysci-traffic.azurewebsites.net
Manual:
- Navigate to API root (127.0.0.1:8000, or the demo link above).
- Select the link http://citysci-traffic.azurewebsites.net/records/
- Click "Filters" in the top right
- Enter the details you would like to filter by
Programatic:
-
Generate a url with the necessary query paramaters. For example: http://citysci-traffic.azurewebsites.net/records/?year=2000&estimation_method=Counted&road=A381
Would filter records by:
- Year: 2000
- Estimation Method: Counted
- Road: A381