Advertisement
Guest User

Untitled

a guest
Mar 1st, 2016
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. @app.route('/login/', methods=["GET","POST"])
  2. def login_page():
  3.  
  4. error = ''
  5. try:
  6.  
  7. if request.method == "POST":
  8.  
  9. attempted_username = request.form['username']
  10. attempted_password = request.form['password']
  11.  
  12. #flash(attempted_username)
  13. #flash(attempted_password)
  14.  
  15. if attempted_username == "admin" and attempted_password == "password":
  16. return redirect(url_for('dashboard'))
  17. else:
  18. return render_template("login.html", error = "Invalid credentials. Try Again.")
  19.  
  20. except Exception as e:
  21. #flash(e)
  22. return render_template("login.html", error = error)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement