How to reset Django admin password?
You may try through console:
python manage.py shell
then use following script in shell
from django.contrib.auth.models import User
User.objects.filter(is_superuser=True)
will list you all super users on the system. if you recognize yur username from the list:
usr = User.objects.get(username='your username')
usr.set_password('raw password')
usr.save()
and you set a new password (:
python manage.py createsuperuser
will create another superuser, you will be able to log into admin and rememder your username.- Yes, why not.
To give a normal user privileges, open a shell with python manage.py shell
and try:
from django.contrib.auth.models import User
user = User.objects.get(username='normaluser')
user.is_superuser = True
user.save()
python manage.py changepassword <user_name>
see docs
You can create a new superuser with createsuperuser
command.