We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The documentation gives this example:
@auth.hash_password def hash_pw(password): return md5(password).hexdigest()
But this code raises two exceptions:
TypeError: hash_pw() takes 1 positional argument but 2 were given
After the above is fixed:
... return hashlib.sha512(password).hexdigest() TypeError: Unicode-objects must be encoded before hashing
The following code works:
@auth.hash_password def hash_pw(username, password): return hashlib.sha512(password.encode("utf8")).hexdigest()
I am using Python 3.7 and Flask is served through gevent.
Thanks!
The text was updated successfully, but these errors were encountered:
c38c523
Yes, I have updated the docs with the correct usage. Thanks!
Sorry, something went wrong.
No branches or pull requests
The documentation gives this example:
But this code raises two exceptions:
After the above is fixed:
The following code works:
I am using Python 3.7 and Flask is served through gevent.
Thanks!
The text was updated successfully, but these errors were encountered: