Created
September 29, 2014 02:48
-
-
Save hughes/014103d2b0e097329e1c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from passlib.apps import custom_app_context as pwd_context | |
class User(db.Model): | |
# ... | |
def set_password(self, password): | |
self.password_hash = pwd_context.encrypt(password) | |
def verify_password(self, password): | |
return pwd_context.verify(password, self.password_hash) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment