def delete(id):
    """Delete a post.

    Ensures that the post exists and that the logged in user is the
    author of the post.
    """
    get_post(id)
    db = get_db()
    db.execute("DELETE FROM post WHERE id = ?", (id,))
    db.commit()
    return redirect(url_for("blog.index"))
Delete a post.

    Ensures that the post exists and that the logged in user is the
    author of the post.
    
examples/tutorial/flaskr/blog.py