Django admin lost password

I have some data in my dev database (not yest exported to fixtures), so I don't want to run syncdb.

However, I lost my pwd for the admin section on my django demo site (I haven't worked on it for a while)

Is the password stored somewhere in the settings / settings, etc.?

How can I recover admin pwd?

+3
source share
1 answer

If you have Django 1.2 installed, you can just call ./manage.py changepassword <username>.

If your version of Django is older, you can change the password in the Django interactive shell:

>>> from django.contrib.auth.models import User
>>> u = User.objects.get(username='<username>')
>>> u.set_password('<password>')
>>> u.save()
+7
source

Source: https://habr.com/ru/post/1771153/


All Articles