django的admin密码重置

项目目录下执行 python3 manage.py shell

>>> from django.contrib.auth.models import User

>>> user = User.objects.get(username='admin')

>>> user.set_password('123456')

>>> user.save()

 

 

posted @ 2022-05-09 22:28  吕晋峰  阅读(160)  评论(0编辑  收藏  举报