From 9292cb34e74bf251859cce32a14ac477d57effe5 Mon Sep 17 00:00:00 2001 From: jieun Date: Tue, 4 Apr 2017 17:13:40 -0400 Subject: [PATCH] add a route so that there is a new page at /allposts where all posts from users can be seen. by default, it is public --- app/views.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/views.py b/app/views.py index 6b5df37..0d3945a 100644 --- a/app/views.py +++ b/app/views.py @@ -79,6 +79,14 @@ def index(page=1): form=form, posts=posts) +@app.route('/allposts', methods=['GET', 'POST']) +def allposts(): + form = PostForm() + posts = Post.query.all() + return render_template('allposts.html', + title='allposts', + form=form, + posts=posts) @app.route('/login', methods=['GET', 'POST']) @oid.loginhandler