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

2019-08-20 16:22:16 浏览数 (1)

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)

0 人点赞