Advertisement
Guest User

Untitled

a guest
Mar 28th, 2016
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. @app.route("/secret")
  2. @fresh_login_required
  3. def secret():
  4. return render_template("secret.html")
  5.  
  6. @app.route("/login", methods=["GET", "POST"])
  7. def login():
  8. <...login-checking code omitted...>
  9. if user_is_logged_in:
  10. flash("Logged in!")
  11. return redirect(request.args.get("next") or url_for("index"))
  12. else:
  13. flash("Sorry, but you could not log in.")
  14. return render_template("login.html")
  15.  
  16. <form name="loginform" action="{{ url_for('login') }}" method="POST">
  17. Username: <input type="text" name="username" size="30" /><br />
  18. Password: <input type="password" name="password" size="30" /><br />
  19. <input type="submit" value="Login" /><br />
  20.  
  21. <form name="loginform" action="{{ url_for('login') }}" method="POST">
  22.  
  23. <form name="loginform" method="POST">
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement