This is a test task for a job posted by Pageloot.
It is not a production-ready setup, as it uses development server and sql-lite db, does not use Docker etc. It requires Linux (Ubuntu) to run with python 3.10+, and virtualenv.
To start the app:
pip install virtualenvpython -m virtualenv .venv --python=python3source .venv/bin/activatepip install -r requirements.txtcd use_expenses/python manage.py migratepython manage.py createsuperuserpython manage.py runserver- Create user via the admin page:
http://127.0.0.1:8000/admin/expenses/user/
Now you can use the API:
curl -H 'Content-Type:application/json' --data '{"user": "[email protected]", "title": "junk food", "amount": "142.43", "category": "food"}' -X POST 'http://127.0.0.1:8000/expenses/' -i
curl -X GET 'http://127.0.0.1:8000/expenses/' -i
curl -X GET 'http://127.0.0.1:8000/expenses/3/' -i
curl -X PUT -H 'Content-Type:application/json' --data '{"user": "[email protected]", "title": "updated title", "amount": "111.11", "category": "other"}' 'http://127.0.0.1:8000/expenses/3/' -i
curl -X PATCH -H 'Content-Type:application/json' --data '{"amount": "222.22"}' 'http://127.0.0.1:8000/expenses/3/' -i
curl -X GET 'http://127.0.0.1:8000/expenses/3/' -i
curl -X GET 'http://127.0.0.1:8000/users/[email protected]/expenses/?start_date=2025-11-02&end_date=2026-09-01' -i
curl -X GET 'http://127.0.0.1:8000/users/[email protected]/expenses_by_category/?date=2025-11-02
The API is described via DRF browsable web API available at http://127.0.0.1:8000/ (no auth required).
Initial estimate included possible use of db like PostgreSQL with docker compose, web/app server, start up scripts, tests/linters etc, but it's not used here to reduce time spent.