reset django admin password


/ Published in: Django
Save to your folder(s)

lost your django admin password? here's how to reset it.


Copy this code and paste it in your HTML
  1. $ ./manage.py shell
  2. >>> from django.contrib.auth.models import User
  3. >>> users = User.objects.all()
  4. >>> users
  5. >>> u=User.objects.get(username__exact='admin')
  6. >>> u.set_password("whatever");
  7. >>> u.save()

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.