The back-end of a CRUD todo list application made with Django
| Description | Method | URL |
|---|---|---|
| Create new todo | POST | /api/todos/ |
| Get list of all todos | GET | /api/todos/ |
| Clear all todos | DELETE | /api/todos/clear/ |
| Reorder todo list | PATCH | /api/todos/sort/ |
| Delete single todo | DELETE | /api/todos/int:pk/ |
| Mark todo as done | PATCH | /api/todos/int:pk/complete |
- Add new todo
- Delete todo
- Clear todo list
- Mark todo as done
- Show todo list
- Reorder todo list
Clone repository
git clone https://github.com/benfir123/todolistapi.git
cd todolistapi
Install the requirements
pip install -r requirements.txt
Run app in development mode
python manage.py runserver
Make test calls to the API by visiting http://localhost:8000/api
This todo list was developed following Test First principles. All the requirements were converted into test cases and code was then refactored to pass said cases. We create a simple todo model with 3 fields: title, is_completed, and position. The position field is a positive integer and is used to manage the order of the todo list items in the database. This is known as an Array structure scheme of sorting a list. This approach has lower insert and update performance than other options but is simple and easy to query.