Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @app.route('/login/', methods=["GET","POST"])
- def login_page():
- error = ''
- try:
- if request.method == "POST":
- attempted_username = request.form['username']
- attempted_password = request.form['password']
- #flash(attempted_username)
- #flash(attempted_password)
- if attempted_username == "admin" and attempted_password == "password":
- return redirect(url_for('dashboard'))
- else:
- return render_template("login.html", error = "Invalid credentials. Try Again.")
- except Exception as e:
- #flash(e)
- return render_template("login.html", error = error)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement