Django 忘记管理员或忘记管理员密码 重设登录密码的方法
作者:GeekLeee 时间:2021-02-14 09:40:46
看到标题就知道有逗比忘了密码。。。没错就是我。
你也忘了密码? 不要着急!
0x00:
第一步:运行django shell
python3 manage.py shell
0x01:
第二步:重设密码
>>> from django.contrib.auth.models import User
>>> user = User.object.get(username='your_account')
>>> user.set_password('your_new_password')
>>> user.save()
>>> quit()
0x02:
如果你连管理员用户名都忘了。。。
没事别慌。。
>>> from django.contrib.auth.models import User
>>> user = User.objects.get(pk=1)
>>> user
<User: you_account>
>>> user.set_password('your_new_password')
>>> user.save()
>>> quit()
还是有办法的。。。
来源:https://blog.csdn.net/GeekLeee/article/details/73251153
标签:Django,管理员,密码
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
用户研究角度看设计(1)“复制链接”的故事
2008-12-26 17:48:00
Python决策树分类算法学习
2023-01-28 17:27:05
![](https://img.aspxhome.com/file/2023/2/79492_0s.png)
使用python opencv对目录下图片进行去重的方法
2023-07-06 20:04:13
css实现简单圆角效果
2008-11-27 13:11:00
![](https://img.aspxhome.com/file/UploadPic/200811/27/e59c86e8a792-560x156-82s.jpg)
SQL Server数据库管理常用SQL和T-SQL语句
2009-05-07 14:01:00
Python PaddleNLP开源实现快递单信息抽取
2023-01-21 04:35:11
![](https://img.aspxhome.com/file/2023/3/80603_0s.jpg)
简单的asp采集代码教程
2011-04-18 10:39:00
浅析PHP中的字符串编码转换(自动识别原编码)
2023-09-08 08:04:44
谈谈设计师的发展
2009-03-17 18:20:00
Python 12306抢火车票脚本
2023-09-12 13:36:11
tensorflow实现对图片的读取的示例代码
2023-07-20 06:07:30
![](https://img.aspxhome.com/file/2023/7/63517_0s.jpg)
Python实现微信机器人的方法
2023-01-20 17:33:26
![](https://img.aspxhome.com/file/2023/4/64714_0s.jpg)
Oracle数据库编写有效事务指导方针
2009-03-19 17:41:00
Python查询缺失值的4种方法总结
2023-10-29 13:42:08
![](https://img.aspxhome.com/file/2023/1/90871_0s.png)
MYSQL的DATE_FORMAT()格式化日期
2009-02-27 16:04:00
python中的内置函数max()和min()及mas()函数的高级用法
2023-01-21 18:45:43
![](https://img.aspxhome.com/file/2023/6/76096_0s.jpg)
Python 正则表达式实现计算器功能
2023-09-02 02:01:44
![](https://img.aspxhome.com/file/2023/1/93511_0s.png)
详解PHP实现HTTP服务器过程
2023-05-26 20:17:12
Python基于yaml文件配置logging日志过程解析
2022-04-02 10:50:36
如何编写python的daemon程序
2023-07-27 05:13:28