This document provides an overview of the API endpoints available in the Project Name project.
- Method:
POST
- Description: Register a new user.
- Parameters:
username
(string): The username of the new user.password
(string): The password of the new user.
- Response:
- Status Code:
201 Created
- Content: JSON object containing user details.
- Status Code:
- Method:
POST
- Description: Log in an existing user.
- Parameters:
username
(string): The username of the user.password
(string): The password of the user.
- Response:
- Status Code:
200 OK
- Content: JSON object containing authentication token.
- Status Code:
- Method:
GET
- Description: *Retrieve a list of all todos.
- For the authenticated users show the authors of the todos
- Able to filter by date
- Response:
- Status Code:
200 OK
- Content: JSON array containing todo objects.
- Status Code:
- Method:
POST
- Description:
- Create a new todo.
- Only authenticated users can create todos
- Parameters:
title
(string): The title of the todo.description
(string): The description of the todo.author
(int): The id of the author
- Response:
- Status Code:
201 Created
- Content: JSON object containing the created todo.
- Status Code:
- Method:
PUT
- Description:
- Update todo by id.
- Updates todos those created within 24 hours
- Parameters:
title
(string, optional): The updated title of the todo.description
(string, optional): The updated description of the todo.
- Response:
- Status Code:
200 OK
for successful update.204 No Content
for successful deletion.
- Status Code:
To set up and run the Project Name project, follow these instructions:
-
Clone the repository from GitHub:
https://github.com/Jumanazarov-Shukrullo/todo-app.git
-
Build the Docker image using the provided Dockerfile:
docker build -t project-name .
-
Run a Docker container based on the built image:
docker run -it --rm -p 8000:8000 project-name
-
Apply migrations to create the database schema:
docker exec -it <container_id> python manage.py migrate
-
Optionally, create a superuser for accessing the Django admin interface:
docker exec -it <container_id> python manage.py createsuperuser