This project is a Task Management API built using Django REST Framework. It provides endpoints to manage tasks, including creating, updating, deleting, and viewing tasks. The API supports user authentication and task assignments to users.
The key features include:
- User registration and authentication.
- CRUD operations on tasks.
- Task assignment to users.
- Filtering tasks by status, due date, etc.
- Python 3.x
- Django 3.x+
- Django REST Framework
- Virtual Environment (Optional, but recommended)
-
Clone the repository:
git clone https://github.com/UnknownLoop11/Task-Management-API.git cd Task-Management-API
-
Create and activate a virtual environment:
python3 -m venv venv source venv/bin/activate # On Windows use `venv\Scripts\activate`
-
Install the required dependencies:
pip install -r requirements.txt
-
Apply migrations:
python manage.py migrate
-
Create a superuser (admin) (optional):
python manage.py createsuperuser
-
Run the development server:
python manage.py runserver
-
The API will be available at
http://127.0.0.1:8000/
.
-
POST
/api/auth/login/
- Request body:
{ "username": "exampleuser", "password": "password123" }
- Response:
{ "access": "your_jwt_token", "refresh": "your_refresh_token" }
- Request body:
-
POST
/api/auth/register/
- Request body:
{ "username": "newuser", "email": "newuser@example.com", "password": "newpassword" }
- Request body:
-
GET
/api/tasks/
- Retrieve all tasks (requires authentication)- (Optional) Parameters for Filtering:
- status - [ 'pending', 'in_progress', 'completed' ]
- priority - [ 'low', 'medium', 'high' ]
- sort_by - [ 'created_at', 'due_date' ]
- Response:
[ { "id": 1, "title": "Finish the project", "description": "Complete the API development by the end of the week", "status": "Pending", "due_date": "2024-10-20", "created_at": "2024-10-14T09:24:47.602577Z", "user": 1 } ]
- (Optional) Parameters for Filtering:
-
POST
/api/tasks/
- Create a new task (requires authentication)- Request body:
{ "title": "Complete unit testing", "description": "Ensure all test cases pass for task management", // Optional "status": "pending", // ['pending', 'in_progress', 'completed'] "priority": "low", // ['low', 'medium', 'high'] "due_date": "2024-10-18" // YYYY-mm-dd }
- Response:
{ "id": 2, "title": "Complete unit testing", "description": "Ensure all test cases pass for task management", "status": "In Progress", "due_date": "2024-10-18" "created_at": "2024-10-14T09:24:47.602577Z", "user": 1 }
- Request body:
-
GET
/api/tasks/<id>/
- Get task detail- Request body:
{ "id": 2, "title": "Complete unit testing", "description": "Ensure all test cases pass for task management", "status": "In Progress", "due_date": "2024-10-18" "created_at": "2024-10-14T09:24:47.602577Z", "user": 1 }
- Request body:
-
PUT
/api/tasks/<id>/
- Update an existing task- Request body:
{ "title": "Update unit tests", "status": "Completed" }
- Request body:
-
DELETE
/api/tasks/<id>/
- Delete a task
Run the tests using:
python manage.py test
This project is licensed under the MIT License. See the LICENSE file for details.
This file assumes a standard Django REST API setup with common endpoints for authentication and task management. You can update it based on the specific functionality provided in your project and the details in your GitHub repository. Let me know if you need further customization!