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

This commit is contained in:
jieun 2017-04-04 17:13:40 -04:00
parent a0fc766502
commit 9292cb34e7
1 changed files with 8 additions and 0 deletions

View File

@ -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