Skip to content

muhammedshibilm/todoapi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Todo API

This is a Django-based Todo API that allows users to register, login, create, update, delete todos, and refresh access tokens using JWT authentication.

Getting Started

Follow the instructions below to get started with the Todo API.

Prerequisites

  • Python 3.x
  • Django
  • Django Rest Framework
  • Virtual Environment (Optional but recommended)

Installation

  1. Clone the repository:

    git clone https://github.com/muhammedshibilm/todo-api.git
  2. Navigate to the project directory:

    cd todo-api
  3. Install dependencies:

    pip install -r requirements.txt
  4. Run migrations:

    python manage.py migrate
  5. Start the server:

    python manage.py runserver

Usage

Registration

  • Endpoint URL: https://todoapi-teal.vercel.app/api/register/
  • Method: POST
  • Request Body:
    {
        "username": "raju",
        "email": "abc@gmail.com",
        "password": "123"
    }

Login

  • Endpoint URL: https://todoapi-teal.vercel.app/api/login/
  • Method: POST
  • Request Body:
    {
        "username": "raju",
        "password": "123"
    }

Access Token Refresh

  • Endpoint URL: https://todoapi-teal.vercel.app/api/token/refresh/
  • Method: POST
  • Request Body:
    {
        "refresh": "<your_refresh_token>"
    }

Create Todo

  • Endpoint URL: https://todoapi-teal.vercel.app/api/todos/create/
  • Method: POST
  • Request Body:
    {
        "title": "Check emails",
        "completed": false
    }

Get Todos

  • Endpoint URL: https://todoapi-teal.vercel.app/api/todos/
  • Method: GET

Update Todo

  • Endpoint URL: https://todoapi-teal.vercel.app/api/todos/edit/<id>/
  • Method: PUT or PATCH
  • Request Body:
    {
        "title": "Check github",
        "completed": true
    }

Delete Todo

  • Endpoint URL: https://todoapi-teal.vercel.app/api/todos/delete/<id>/
  • Method: DELETE

Contributing

Contributions are welcome! Please feel free to submit pull requests.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Acknowledgments