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.

./ changepassword admin changepassword admin

You can also change a password programmatically:

from django.contrib.auth.models import User
admin = User.objects.get(username='admin')
This post is available on GitHub.
Posted .


Leave a Reply