Skip to content

AbHIsHEK4011/Django-Task-Management

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Django Task Management API

This is a Task Management API built using Django and Django REST Framework (DRF). The API allows users to create tasks, assign tasks to users, and retrieve assigned tasks.


📌 Features

  • User authentication using JWT (JSON Web Token).
  • Create, update, and delete tasks.
  • Assign tasks to multiple users.
  • Retrieve tasks assigned to a specific user.

📂 Project Setup

1️⃣ Clone the Repository

git clone https://github.com/AbHIsHEK4011/Django-Task-Management.git
cd task_management

2️⃣ Create a Virtual Environment

python -m venv venv
source venv/bin/activate  # On Windows use: venv\Scripts\activate

3️⃣ Install Dependencies

pip install -r requirements.txt

4️⃣ Apply Database Migrations

python manage.py migrate

5️⃣ Create a Superuser (Admin User)

python manage.py createsuperuser

Enter username, email, and password when prompted.

6️⃣ Run the Development Server

python manage.py runserver

Server will start at: http://127.0.0.1:8000/


🔐 Authentication (JWT)

1️⃣ Obtain Access Token

  • Endpoint: POST /api/token/
  • Request Body:
    {
      "username": "admin",
      "password": "adminpassword"
    }
  • Response:
    {
      "access": "your-access-token",
      "refresh": "your-refresh-token"
    }

2️⃣ Use the Token in Requests

Add the following header to authenticate:

{
  "Authorization": "Bearer your-access-token"
}

3️⃣ Refresh Token

  • Endpoint: POST /api/token/refresh/
  • Request Body:
    {
      "refresh": "your-refresh-token"
    }

📌 API Endpoints

1️⃣ Create a Task

  • Endpoint: POST /api/tasks/
  • Headers:
    {
      "Authorization": "Bearer your-access-token",
      "Content-Type": "application/json"
    }
  • Request Body:
    {
      "name": "Fix Bug in App",
      "description": "Resolve issue in authentication module",
      "task_type": "Bug Fix",
      "status": "pending"
    }

2️⃣ Assign Task to Users

  • Endpoint: POST /api/assign_task/
  • Request Body:
    {
      "task_id": 1,
      "user_ids": [2, 3]
    }

3️⃣ Get Tasks for a Specific User

  • Endpoint: GET /api/users/{user_id}/tasks/

4️⃣ Update Task

  • Endpoint: PATCH /api/tasks/{task_id}/
  • Request Body:
    {
      "status": "completed"
    }

5️⃣ Delete a Task

  • Endpoint: DELETE /api/tasks/{task_id}/

📞 Support

If you have any questions, feel free to open an issue in the repository!

About

Task Management API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages