This is a Django-based REST API for a Todo application. It provides user authentication and CRUD operations for managing todos. The API follows RESTful principles and includes user registration, login, and logout functionalities. This API was created as part of Assignment 1 for my CI/CD course. I am currently studying at the Auckland Institute of Studies.
- Demo
- Installation
- Usage
- Features
- API Endpoints
- Environment Variables
- Project Structure
- Testing
- Deployment
- Contributing
- License
A live API demo is available here: Live API Demo
Ensure you have Python installed. Then, clone the repository and set up the project:
git clone https://github.com/NPZlatu/Backend-TodoList
cd <project-name>
python -m venv venv
source venv/bin/activate # On Windows use `venv\Scripts\activate`
pip install -r requirements.txtpython manage.py runserverThe API will be available at http://127.0.0.1:8000/.
python manage.py migrate- User authentication (register, login, logout)
- Create, read, update, and delete (CRUD) operations for todos
- Token-based authentication
- Environment-based configuration management
POST /register/- Register a new userPOST /login/- Login user and obtain an authentication tokenPOST /logout/- Logout the authenticated user
GET /todos/- Retrieve all todosPOST /todos/- Create a new todoGET /todos/<id>/- Retrieve a specific todoPUT /todos/<id>/- Update an existing todoDELETE /todos/<id>/- Delete a todo
Create a .env file in the project root with the following if needed, otherwise use default SQLite:
SECRET_KEY=<your-secret-key>
DB_HOST=<database-host>
DB_NAME=<database-name>
DB_USER=<database-user>
DB_PASSWORD=<database-password>
DB_PORT=<database-password>
📦 Backend-TodoList
├── 📂 todo # Main API application
│ ├── 📂 migrations # Database migrations
│ ├── 📂 tests
├── 📂 unit # unit tests
├── 📂 integration # integration-tests
│ ├── 📜 views.py # API views
│ ├── 📜 serializers.py # API serializers
│ ├── 📜 urls.py # API routes
│ ├── 📜 models.py # Database models
├── 📂 todo_project # Main API project
├── 📜 manage.py # Django entry point
├── 📜 settings.py # Django setting config file
├── 📜 urls.py # URL entry point
├── 📜 wsgi.py # Connecting Django to WSGi servers
├── 📜 .env # Environment variables
├── 📜 requirements.txt # Project dependencies
└── 📜 README.md # Documentation
python manage.py test todo.tests.unitpython manage.py test todo.tests.integrationThe continuous deployment in Vercel has been enabled in this project. Any changes made will be deployed to the Vercel.
- Fork the repository.
- Create a new feature branch:
git checkout -b feature-name - Commit changes:
git commit -m 'Add new feature' - Push to the branch:
git push origin feature-name - Open a pull request.
This project is licensed under the MIT License.