every blog every motto:You can do more than you think.
/weixin_39190382?type=blog
0. 前言
django 忘记管理员账号/密码找回
1. 正文
1.1 重置密码
step1:
终端输入:
python mange.py shell
step 2:
依次输入如下代码:
>>> from django.contrib.auth.models import User>>> user = User.object.get(username='your_account')>>> user.set_password('your_new_password')user.save()
1.2 忘记用户名
>>> from django.contrib.auth.models import User>>> user = User.objects.get(pk=1)>>> user
>>> user.set_password('your_new_password')>>> user.save()
参考:
[1] /qq_41856814/article/details/89461066