How to Reset a Django Admin Password
The most efficient way to change your admin password on a Django site.
This is just a quick post to give a tip on how to recover or reset your Django admin username and/or password.
Use your django shell to query the User model.
1python manage.py shell
1from django.contrib.auth.models import User
If you can't remember your username, you can view all users in the system.
1for u in User.objects.all(): print u.username
Once you know your username, you can simply reset the password:
1u = User.objects.get(username='dustin')2u.set_password('secret') u.save()