Django Reset Admin User's Password

Change a user's password from the command line, use the changepassword command. It will prompt you to change the password for the specified user.

./manage.py changepassword admin
django-admin.py changepassword admin

You can also change a password programmatically:

from django.contrib.auth.models import User
admin = User.objects.get(username='admin')
admin.set_password('mynewpassword')
admin.save()
Did this help you? Please let me know with a comment. Thank you
Posted .

Comments (RSS)

Leave a comment