I am new to flask and i am writing a basic program for login. Everytime I ammend i end with error mentioned above. below is my code for reference. Can someone please correct me.
@app.route('/')
def index():
return render_template('form_ex.html')
@app.route('/',methods = ['POST'])
def Authenticate():
login = request.form['u']
password = request.form['p']
cursor = mysql.get_db().cursor()
cursor.execute("SELECT * FROM UserLogin WHERE login=%s and password=%s")
data= cursor.fetchone()
if data is None:
return("Username or password incorrect")
else:
return("You are logged in")