Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Start a free Courses trial
to watch this video
Letting users create accounts is great but until we responsibly store the passwords, we really shouldn't open the doors. We'll use the super-strong `bcrypt` library to hash their passwords before the store them so we know our data is secure.
pip install flask-bcrypt
Update
Use from flask_bcrypt import generate_password_hash
instead of from flask.ext.bcrypt import generate_password_hash
Notes
-
flask.ext.bcrypt
- The path where Flask Bcrypt is available. -
generate_password_hash()
- function to generate a hash from a string. Takes an optional number of rounds of hashing to use. More rounds always makes the process take longer. -
check_password_hash()
- function to check a hash against a string to see if they match.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up