Giter Site home page Giter Site logo

todo-app's Introduction

TODO API Documentation

This document provides an overview of the API endpoints available in the Project Name project.

Register User

Endpoint: api/register/

  • 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.

Login User

Endpoint: api/login/

  • 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.

List Todos

Endpoint: api/todo/all/

  • 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.

Create Todo

Endpoint: api/todo/create/

  • 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.

Update Todo

Endpoint: api/todo/<int:pk>/

  • 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.

Project Setup Instructions

To set up and run the Project Name project, follow these instructions:

  1. Clone the repository from GitHub:

    https://github.com/Jumanazarov-Shukrullo/todo-app.git
  2. Build the Docker image using the provided Dockerfile:

     docker build -t project-name .
  3. Run a Docker container based on the built image:

    docker run -it --rm -p 8000:8000 project-name
  4. Apply migrations to create the database schema:

    docker exec -it <container_id> python manage.py migrate
  5. Optionally, create a superuser for accessing the Django admin interface:

    docker exec -it <container_id> python manage.py createsuperuser

todo-app's People

Contributors

jumanazarov-shukrullo avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.