The Todo_List Django Web App offers the following features:
User Authentication
ToDo List
Create a virtual environment
Activate the virtual environment
source myenv/bin/activate
python manage.py makemigrations
python manage.py migrate
python manage.py createsuperuser
python manage.py runserver
How to access each API, with examples and sample response
http://127.0.0.1:8000/api/auth/register
{ "username":"Nirmal",
"email":"nirmal@gmail.com",
"password":"12345"
}
{
"status": "success",
"code": 201,
"details": {
"username": "Nirmal",
"email": "nirmal@gmail.com",
"password": "12345"
}
}
http://127.0.0.1:8000/api/auth/login
{
"username": "Nirmal",
"password": "12345"
}
{
"token": "52b22533d658d285c506ace40ef5407f67111734"
}
http://127.0.0.1:8000/api/auth/logout
Authorization : Token <token>
{
"message": "Successfully logged out."
}
http://127.0.0.1:8000/categorylist/
Authorization : Token <token>
[
{
"id": 1,
"title": "Personal",
"time": "2024-03-06T10:44:39.227548Z",
"created_date": "2024-03-06T10:44:39.228912Z",
"created_by": 4
},
{
"id": 2,
"title": "Study",
"time": "2024-03-06T11:48:31.761510Z",
"created_date": "2024-03-06T11:48:31.761510Z",
"created_by": 4
}
]
http://127.0.0.1:8000/categorycreate/
Authorization : Token <token>
{
"title":"Sample Title"
}
{
"id": 6,
"title": "Sample Title",
"time": "2024-03-07T11:53:36.322168Z",
"created_date": "2024-03-07T11:53:36.323171Z",
"created_by": 4
}
3. To get the details in each Category
http://127.0.0.1:8000/categorydetails/<str:pk>/
Authorization : Token <token>
{
"id": 2,
"title": "Study",
"time": "2024-03-06T11:48:31.761510Z",
"created_date": "2024-03-06T11:48:31.761510Z",
"created_by": 4
}
http://127.0.0.1:8000/categoryupdate/<str:pk>
Authorization : Token <token>
{
"title":"Updated Sample",
"created_by": 4
}
{
"message": "Title updated successfully",
"data": {
"id": 2,
"title": "Updated Sample",
"time": "2024-03-06T11:48:31.761510Z",
"created_date": "2024-03-06T11:48:31.761510Z",
"created_by": 4
}
}
http://127.0.0.1:8000/categorydelete/<str:pk>/
Authorization : Token <token>
{
"message": "success,Category deleted"
}
http://127.0.0.1:8000/tasklist/
Authorization : Token <token>
[
{
"id": 1,
"title": "Rest api",
"description": "description of the project",
"created": "2024-03-07T06:49:27.426133Z",
"started": null,
"ended": null,
"status": false,
"created_date": "2024-03-07T06:49:27.426133Z",
"category": null,
"created_by": 4
}
]
http://127.0.0.1:8000/taskcreate/
Authorization : Token <token>
{
"title": "Project2",
"category_id": 2,
"description": "description of the project.",
"status": false
}
{
"id": 10,
"title": "Project2",
"description": "description of the project.",
"created": "2024-03-11T05:25:07.158581Z",
"started": null,
"ended": null,
"status": false,
"created_date": "2024-03-11T05:25:07.158581Z",
"category": null,
"created_by": 4
}
http://127.0.0.1:8000/taskupdate/<str:pk>/
Authorization : Token <token>
{
"title":"Updated project 2",
"description": "description of the project",
"created_by": 4
}
{
"message": "Task updated successfully",
"data": {
"id": 11,
"title": "Updated project 2",
"description": "description of the project",
"created": "2024-03-11T05:30:17.092751Z",
"started": null,
"ended": null,
"status": false,
"created_date": "2024-03-11T05:30:17.092751Z",
"category": null,
"created_by": 4
}
}
http://127.0.0.1:8000/taskdelete/3/
Authorization : Token <token>
{
"message": "success,User deleted"
}