This comes straight from the Useful Django Tip department: How do you reset the admin password for a Django project when you’ve forgotten it?
Bruce Kroeze suggested using Django’s shell to resolve this common issue and one of the comments his post received nailed it:
[omaciel@crutches souschef]$ python manage.py shell Python 2.6.5 (r265:79063, Mar 22 2010, 10:30:12) Type "copyright", "credits" or "license" for more information. IPython 0.10 -- An enhanced Interactive Python. ?Â Â Â Â Â Â Â Â -> Introduction and overview of IPython's features. %quickref -> Quick reference. helpÂ Â Â Â Â -> Python's own help system. object?Â Â -> Details about 'object'. ?object also works, ?? prints more. In : from django.contrib.auth.models import User In : u = User.objects.get(username__exact="admin") In : u.set_password('whatever'); In : u.save()
P.S.: Back by popular demand, posts in its full content!