hello,
i think there is an error in login function,
every things works but when i try to login with my username i got this error:
TypeError
TypeError: tuple indices must be integers, not str
File "/home/***/Desktop/myflaskapp/app.py", line 139, in login
result = cur.execute("SELECT * FROM users WHERE username = %s", [username])
if result > 0:
# Get stored hash
data = cur.fetchone()
password = data['password']
# Compare Passwords
if sha256_crypt.verify(password_candidate, password):
# Passed
session['logged_in'] = True
TypeError: tuple indices must be integers, not str
hello,
i think there is an error in login function,
every things works but when i try to login with my username i got this error:
TypeError
TypeError: tuple indices must be integers, not str
File "/home/***/Desktop/myflaskapp/app.py", line 139, in login
result = cur.execute("SELECT * FROM users WHERE username = %s", [username])
if result > 0:
# Get stored hash
data = cur.fetchone()
password = data['password']
# Compare Passwords
if sha256_crypt.verify(password_candidate, password):
# Passed
session['logged_in'] = True
TypeError: tuple indices must be integers, not str