Skip to content

Instantly share code, notes, and snippets.

@JohnnyFang
Created December 29, 2018 00:54
Show Gist options
  • Save JohnnyFang/4e165dc153ad33ea1f787e6834a0f43b to your computer and use it in GitHub Desktop.
Save JohnnyFang/4e165dc153ad33ea1f787e6834a0f43b to your computer and use it in GitHub Desktop.
Flask todo app - webapp views.py
# app/webapp/views.py
from flask import render_template
from app.models import Todo
from . import webapp
@webapp.route('/')
def index():
all_todos = Todo.query.all()
return render_template("index.html", todos=all_todos)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment