📜  django 设置随机密码 - Python 代码示例

📅  最后修改于: 2022-03-11 14:46:58.243000             🧑  作者: Mango

代码示例1
from django.contrib.auth.models import User

password = User.objects.make_random_password()
user.set_password(password)
user.save()