qdyxmas's Room

Done is better than perfect...

flask 数据库中添加用户名密码

生成密码

from werkzeug.security import generate_password_hash
pwd=generate_password_hash('123456')
#pwd='pbkdf2:sha1:1000$rmftwbH0$7344743f3e6d9c11750815aba6d78c7255a4abcc'
mail="123456@qq.com"
avatar_hash=hashlib.md5(mail.encode('utf-8')).hexdigest()
#avatar_hash='35de170fc7836ea645e1a7d7b307ff6e'

INSERT INTO users VALUES (id, 'username', mail, pwd, 3, avatar_hash);

标签 

评论