Resetting Django Admin Password

by pk on August 7, 2008

This barely qualifies for a blog post, but what to do if you loaded, via django-admin.py loaddata
a full json file from someone during testing, and don’t have their user’s password?

Just run the django-admin.py shell, and by hand reset all the passwords:

from django.contrib.auth.models import User
for u in Users:
u.set_password(’secret’)
u.save()

That’s why you have to keep your shell login and settings files safe !!

  • Share/Bookmark

{ 1 comment… read it below or add one }

Empty August 10, 2008 at 4:42 pm

If you’re using Django Command Extensions (http://code.google.com/p/django-command-extensions/) you can just use the passwd management command.

Leave a Comment

Previous post: Scratch Conference at MIT

Next post: Serving favicon in an Django App using Apache