Update Django user password from shell

Enter Django Shell

python manage.py shell

Update password

from django.contrib.auth.models import User

users = User.objects.all() 

print(users)

user = users[0]

user.set_password('123')
user.save()

If you are using custom user model

from your_app.auth.models import User

users = User.objects.all() 

print(users)

user = users[0]

user.set_password('123')
user.save()

Comments

comments powered by Disqus