A backend application for a TODO list, implemented in Python using Flask and SQLite database.
- Python 3.6 or higher
- Flask and Flask-SQLAlchemy
- Clone the repository: https://github.com/prathameshpatil2002/Todo-List-Application-using-Flask.git
- Change into the project directory : cd Todo-List-Application-using-Flask
- Install the dependencies : pip install -r requirements.txt
To start the server, run the following command:
python app.py
By default, the application will run on http://localhost:5000
The following API endpoints are available:
- / - Default Route shows all tasks completed/incomplete.
- GET /tasks - Get a list of all tasks
- POST /tasks - Create a new task
- POST /tasks/update/:id - Update a task
- /tasks/delete/:id - Delete a task
- /tasks/complete/:id - Mark a task as completed
- /tasks/incomplete/:id - Mark a task as incomplete
To create a new task, make a POST request to http://localhost:5000/tasks with the following JSON payload:
{
"title": "Buy Groceries",
"description": "Milk, Bread, Eggs"
}
To get a list of all tasks, make a GET request to http://localhost:5000/tasks.
To update a task, make a POST request to http://localhost:5000/tasks/update/:id with the following JSON payload:
{
"title": "Buy Groceries",
"description": "Milk, Bread, Eggs, Cheese"
}
To delete a task, make a request to http://localhost:5000/tasks/delete/:id.
To mark a task as completed, make a request to http://localhost:5000/tasks/complete/:id.
To mark a task as incomplete, make a request to http://localhost:5000/tasks/incomplete/:id.
This is a simple TODO list application, but it can be extended in various ways, such as adding user authentication, due dates, and more. Feel free to modify and improve this application to fit your needs!