Python rewrite of my fuel tracker from PHP. Largely just an excuse to play with Django.
- Python 3.5+
- Django
- Django REST Framework
- Django-environ
- mysqlclient see below
backend/requirements.txt is a pip freeze
of the full environment. It contains some helper scripts for AWS ElasticBeanstalk hosting.
- Node.js 8.10.0+
- React
- React Bootstrap
- React Router
Again, the above are the main pieces and the full compliment is in frontend/package.json. Managed using Create React App.
The backend/pyfuel/.env.example file outlines the environment variables that are required by the backend, most are security related in Django.
The frontend/.env.example file outlines the environment variables for the front end.
MySQL was used for legacy reasons. Using any supported Django backend on a fresh instance should not pose any issues.
There were problems with some functions only properly supporting positional arguments on PostgreSQL which led to some limitations/early frustrations.
Served by the frontend providing a basic reporting overview of fuel and vehicle data.
Served by the backend it outlines all routes and endpoints available in addition to the API itself.
Anonymouse requests are restricted to only safe methods (GET
, HEAD
, OPTIONS
). All methods are available to authenticated requests.
To authenticate, include your token in the HTTP Authorization
header, prefixed by the string literal "Token".
The browsable API includes a log in option for accessing html forms of the protected methods.
Example header:
Authorization: Token meowmeowmeow123