Flask: Secure password the with werkzeug hashing

Werkzeug started is a simple collection of various utilities for WSGI applications and it becomes one of the most advanced WSGI utility modules in Python and is used to build many advanced frameworks such as Flask.

Here is how you can use Werkzeug hashing in your apps. In order to do this, you may need the following import statement.

from werkzeug.security import generate_password_hash, check_password_hash

The hashing is simplified with generate function.

hash_password = generate_password_hash(form.password.data, method='sha256')

The check password method will validate the input. In both cases, you can see the URL contain the hash strings instead of the regular password string.

For more help Please refer, 


Click to access werkzeug.pdf




Published by


A developer,teacher and a blogger obsessed with Python,Dart and open source world from India

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.