filmov
tv
How to reset the Django admin and superuser password

Показать описание
How to reset the Django admin and superuser password
Find your username:
Start the shell
____________________
_______________________
We can find out what usernames are used for admin with this:
________________________________________________________________________
________________________________________________________________________
You will now get a result similar to this:
__________
['p_admin']
___________
If you get multiple results, you have multiple superuser. Pick the one that you want to change the password from.
Reset your Django admin password:
Open up the Django shell if you haven't yet. Then enter this:
_________________________________________________
def reset_password(u, password):
try:
except:
return "User could not be found"
return "Password has been changed successfully"
________________________________________________
That's the function we will use to change the password of a user. Up next, you can simply do:
__________________________________
reset_password('username', 'password')
____________________________________
Obviously, change the username with the username of your superuser account and change the password with something you want to use as a password.
Let me know in the comments below if you still need help with resetting your Django admin password.
I used hp laptop with windows 8.1 installed and Icecream Screen Recorder for this video.
If you found this video useful please sub to me.
Find your username:
Start the shell
____________________
_______________________
We can find out what usernames are used for admin with this:
________________________________________________________________________
________________________________________________________________________
You will now get a result similar to this:
__________
['p_admin']
___________
If you get multiple results, you have multiple superuser. Pick the one that you want to change the password from.
Reset your Django admin password:
Open up the Django shell if you haven't yet. Then enter this:
_________________________________________________
def reset_password(u, password):
try:
except:
return "User could not be found"
return "Password has been changed successfully"
________________________________________________
That's the function we will use to change the password of a user. Up next, you can simply do:
__________________________________
reset_password('username', 'password')
____________________________________
Obviously, change the username with the username of your superuser account and change the password with something you want to use as a password.
Let me know in the comments below if you still need help with resetting your Django admin password.
I used hp laptop with windows 8.1 installed and Icecream Screen Recorder for this video.
If you found this video useful please sub to me.
Комментарии