Django修改用户名密码的方法

 

1.python manage.py shell

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

InitialUsername = User.objects.get(username=username)
InitialUsername.set_password(new_password)
InitialUsername.save()

或者

1.python manage.py changepassword username

posted on 2021-04-01 12:08  牛气冲天  阅读(386)  评论(0编辑  收藏  举报