flash werkzeug计算和验证密码(flask 68)

from werkzeug.security import generate_password_hash, check_password_hash

代码语言:javascript
复制
def set_password(self, password):
    self.password_hash = generate_password_hash(password)

def validate_password(self, password):
return check_password_hash(self.password_hash, password)