Advertisement
Guest User

Untitled

a guest
Mar 2nd, 2015
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. @app.route('/add' , methods=['POST', 'GET'])
  2. def add():
  3. if request.method == 'POST':
  4. post=Post(request.form['title'], request.form['body'])
  5. db.session.add(post)
  6. db.session.commit()
  7. flash('New entry was successfully posted')
  8.  
  9. return render_template('add.html')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement