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:
		
							parent
							
								
									a0fc766502
								
							
						
					
					
						commit
						9292cb34e7
					
				| 
						 | 
				
			
			@ -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
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue