django修改admin密码

Posted on 2016-08-04 15:11  血染&征袍  阅读(195)  评论(0编辑  收藏  举报

python manage.py shell

然后获取你的用户名,并且重设密码:
from django.contrib.auth.models import User 
user = User.objects.get(username='admin')
user.set_password('new_password')
user.save()

Copyright © 2024 血染&征袍
Powered by .NET 9.0 on Kubernetes