标签:ash dict pre utf-8 new model lib hashlib dig
1.导入hashlib库
import hashlib
2.对密码进行加密
newUser = User() #这里的User是我们导入的model m=hashlib.md5() m.update(dictData[‘password‘].encode(‘utf-8‘)) #dictData是前端传过来的form newUser.password = m.hexdigest()
标签:ash dict pre utf-8 new model lib hashlib dig
原文地址:https://www.cnblogs.com/daicw/p/12058504.html