from flask import Flask, render_template, request, redirect, url_for
import logging

logger = logging.getLogger(__name__)

app = Flask(__name__)
from flask_sqlalchemy import SQLAlchemy

app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///tasks.db'
db = SQLAlchemy(app)

class Task(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    description = db.Column(db.String(255), nullable=False)
    completed = db.Column(db.Boolean, default=False)

with app.app_context():

@app.route("/", methods=["GET", "POST"])
def home():

About this template

A great starting point for a feature-rich To-do List app. This skeleton supports adding, editing, deleting, and prioritizing tasks with due dates and reminders. It's built with Flask and SQLAlchemy, ensuring easy database management. The responsive UI is powered by Tailwind CSS, making it user-friendly and visually appealing. Perfect for creating a robust task management system with potential for further enhancements like project management and collaboration tools.

Introduction to the To-Do App Template

Welcome to the step-by-step guide on how to use the To-Do App template on the Lazy platform. This template is designed to help you quickly set up a feature-rich To-Do List application with functionalities such as adding, editing, deleting, and marking tasks as complete or incomplete. The application is built using Flask and SQLAlchemy for backend operations, and Tailwind CSS for a responsive and visually appealing frontend.

Getting Started

To begin using this template, simply click on "Start with this Template" on the Lazy platform. This will pre-populate the code in the Lazy Builder interface, so you won't need to copy, paste, or delete any code manually.

Initial Setup

There is no need for an initial setup of environment variables for this template as it does not require any environment secrets to be set in the Lazy Builder. All necessary libraries and dependencies are already included in the template, and Lazy handles the deployment of the application.

Test: Deploying the App

Once you have started with the template, the next step is to deploy your app to see it in action. Press the "Test" button on the Lazy platform. This will begin the deployment process, and the Lazy CLI will handle any required user input during this phase.

Entering Input

After pressing the "Test" button, if the application requires any user input, the Lazy App's CLI interface will prompt you to provide the necessary information. Follow the instructions in the CLI to enter any required input.

Using the App

Upon successful deployment, Lazy will provide you with a dedicated server link to access your To-Do List application. Navigate to this link to view and interact with the UI of your To-Do App. Here's what you can do with the interface:

  • Add new tasks using the input field and "Add Task" button.
  • Edit existing tasks by clicking on the "Edit" button next to each task.
  • Delete tasks using the "Delete" link associated with each task.
  • Mark tasks as complete or incomplete using the respective links.

The home page will display all tasks, and you can toggle between editing and viewing modes using the "Edit Tasks" button.

Integrating the App

If you wish to integrate this To-Do List app into an external service or frontend, you may need to use the server link provided by Lazy. For example, if you want to embed the To-Do List into another webpage, you can use an iframe with the server link as the source.

Here's a sample code snippet for embedding the To-Do List app:

<iframe src="YOUR_LAZY_SERVER_LINK" width="100%" height="600"></iframe>

Replace "YOUR_LAZY_SERVER_LINK" with the actual link provided by Lazy after deployment.

For further enhancements or custom integrations, you may need to refer to the documentation of the external tools you are using. If the template code provided any links to documentation, make sure to consult them for additional guidance.

By following these steps, you should now have a fully functional To-Do List application running on the Lazy platform. Enjoy managing your tasks with ease!

Last published
July 20, 2024

More templates like this

FALLBACK | Flask, HTML, JS and Tailwind Based Website

This is a good starting point for styled website. It has a header, footer. Has Tailwind and Flowbite loaded so you can build nice looking pages from here.


MP3ify: Youtube to MP3 Converter

A web application that allows users to download YouTube videos from URLs and provides the option to convert them to MP3 format.


Login and Registration

This is a good starting point for any app that requires login and registration

React JS
To-Do App