This Django-based task management system allows users to create, list, update, and delete tasks, with support for bulk adding and deleting. Each task has a title and a completion status.
- Create a new task: Add tasks with a title and completion status.
- List all tasks: View all tasks stored in the system.
- Get a specific task: Retrieve details of a specific task.
- Delete a task: Remove a task from the system.
- Edit a task: Update the title and/or completion status of a task.
- Bulk add tasks: Add multiple tasks in a single request.
- Bulk delete tasks: Remove multiple tasks in a single request.
- Python 3.6 or higher
- Django 3.0 or higher
- Django REST Framework
-
Clone the repository to your local machine.
-
Navigate to the project directory and create a virtual environment:
python -m venv venv
-
Activate the virtual environment:
- On Windows:
venv\Scripts\activate
- On macOS/Linux:
source venv/bin/activate
- On Windows:
Install the required packages using pip:
pip install django djangorestframework
Apply the database migrations to set up your database schema:
python manage.py migrate
Start the Django development server:
python manage.py runserver
The API will be available at http://localhost:8000/.
- List/Create Tasks:
GET
andPOST
/tasks/
- Retrieve/Update/Delete Task:
GET
,PUT
,PATCH
, andDELETE
/tasks/<int:pk>/
- Bulk Add Tasks:
POST
/tasks/bulk_add/
- Bulk Delete Tasks:
DELETE
/tasks/bulk_delete/
-
Adding a New Task:
curl -X POST http://localhost:8000/tasks/ -H "Content-Type: application/json" -d '{"title": "New Task", "is_completed": false}'
-
Bulk Deleting Tasks:
curl -X DELETE http://localhost:8000/tasks/bulk_delete/ -H "Content-Type: application/json" -d '{"ids": [1,2,3]}'