My logging is not redirecting

by: Anikoh, 7 years ago


Please, am stock with my loggin, with flask version 0.12.2 and python 3.5

# This is the login handler
@app.route('/login/', methods = ['GET','POST'])
def login_page():
error = ''
try:
c, conn = connection()
if request.method == "POST":
data = c.execute("SELECT * FROM users WHERE username = (%s)",
kill(request.form['username']))
data = c.fetchone()[2]

if sha256_crypt.verify(request.form['password'], data):
session['loggin_in'] = True
session['username'] = request.form['username']

flash("Welcome!, Dashboard.")
return redirect(url_for("dashboard"))
else:
error = "Invalid entries, try again.!"

gc.collect()

return render_template("login.html", error = error)

except Exception as e:
error = "Invalid entries, try again.!"

return render_template("login.html", error = error)




You must be logged in to post. Please login or register an account.