The last line of the traceback. login_user ['password']) == login_user ['password'].encode ('utf-8'): AttributeError: 'bytes' object has no attribute 'encode'. Tells you that you are passing an object that is of type bytes, not a str. So you are trying to invoke .encode () method on bytes object. You need to check what is the login_user ...
18.03.2020 · I have this code and I'm using python 3.7 def hash_password(password): return bcrypt.hashpw(password.encode('utf8'), bcrypt.gensalt()) def credentials_valid(username, password): …