1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | # Credit goes to colewhitelaw.com for most of this solution.
# start an interactive shell-this assumes you are in the right directory
python manage.py shell
>>> from django.contrib.auth.models import User
# Grab all users and output
>>> userlist = User.objects.all()
>>> userlist
[< User:yourusername >]
# Refer to your required user by index and set new password
>>> userlist[0].set_password('newpasswd')
# Then save it
>>> userlist[0].save()
|
More like this
- Reset / Send account details email by Ciantic 2 years, 10 months ago
- Simple E-mail registration by bthomas 4 years, 7 months ago
- Password Reset Form Newforms by glisha 6 years, 2 months ago
- Old MySQL Password Hash by tback 4 years, 1 month ago
- EncryptField by volksman 4 years, 9 months ago
Comments
Better get the user directly:
or just use whats already built-in:
#