It is quite easy to forget the superuser password of your Django application if the Admin part is not used frequently. We can always create a new superuser but that would not be a good idea from the security perspective.
We can always reset the superuser password of the Django application.
Method 1:
Go to the working directory of your project and run below command.
python manage.py changepassword <username>
This will prompt for new password and then will ask the password again.
(pythoncircle) rana@brahma:pythoncircle$ python manage.py changepassword superuseradmin
Changing password for user 'superuseradmin'
Password:
Password (again):
Password changed successfully for user 'superuseradmin'
(pythoncircle) rana@brahma:pythoncircle$ python manage.py changepassword
CommandError: user 'rana' does not exist
If you are able to login to the admin site using some other super admin credentials, you can change the password from there as well. On the user details page, click on the link with the text "this form" given below password hash details.
Clicking the link will open another page where you can change the password.
Method 3:
The password of a user can be reset using the command:
django-admin changepassword <username>
But this command will work only if Django's authentication system is installed. Read about this command in detail here.
Host your Django Application for free on PythonAnyWhere. If you want the full control on your application and server, you should consider DigitalOcean. Create an account with this link and get $100 credits.