As a developer, while working on a Django project, I forgot the admin password. At first, I thought there would be a simple way to “see” the password, but I quickly realized that Django stores passwords in a hashed format for security.
So, you can’t directly view the admin password. But the good news is, you can easily reset it using a few different methods.
In this tutorial, I’ll show you the exact steps I use when I forget my Django admin password.
I’ll cover three quick methods: using the Django shell, using changepassword, and creating a new superuser.
Method 1 – Reset Password Using Django Shell
The easiest way I’ve found is through the Django shell.
Here’s what I usually do:
- Open your terminal in the project directory.
- Run the following command:
python manage.py shell- Inside the shell, run this code:
from django.contrib.auth.models import User
# Replace 'admin' with your actual username
user = User.objects.get(username='admin')
user.set_password('NewSecurePassword123!')
user.save()
print("Password reset successfully!")- Exit the shell and log in with the new password.
You can refer to the screenshot below to see the output:

This method works great when you remember the username but forgot the password.
Method 2 – Use the changepassword Command
Another quick way is to use the built-in changepassword management command.
Here’s how I do it:
python manage.py changepassword admin- Replace
adminwith your username. - It will ask you to type and confirm the new password.
You can refer to the screenshot below to see the output:

This is my go-to method when I want a simple and direct reset without writing code.
Method 3 – Create a New Superuser
Sometimes, you may not even remember the username. In that case, I simply create a new superuser.
Run this command:
python manage.py createsuperuserIt will ask you for:
- Username
- Email address
- Password
You can refer to the screenshot below to see the output:

Once created, you can log in with the new account.
Later, you can go to Django Admin → Users and reset the password for the original account.
Method 4 – Reset All Admin Passwords with a Script
If you’re working on a team project and multiple admin users have lost access, you can reset passwords in bulk.
Here’s a Python script I use inside the Django shell:
from django.contrib.auth.models import User
# Reset all superuser passwords to the same temporary one
for user in User.objects.filter(is_superuser=True):
user.set_password('TempPassword2025!')
user.save()
print(f"Password reset for {user.username}")After this, all superusers can log in with the temporary password and then change it from the admin panel.
Note
Since Django stores passwords in hashed format, there’s no way to retrieve the old password.
You can only reset it.
This is a good thing; it keeps your project secure.
So, if you ever forget the password, just reset it using one of the methods above.
Conclusion
You can reset it through the Django shell, use the changepassword command, or even create a new superuser if needed. I prefer the shell method because it’s quick and works every time.
But if you’re just starting, the changepassword command is the most beginner-friendly option.
No matter which method you use, you’ll be back in your Django admin panel within minutes.
And remember, Django never lets you “see” the old password for security reasons, so resetting is always the way to go.
You may also like to read other Django tutorials:
- Google Authentication in Django
- Use Django Built-In Login System
- Build a To-Do List API in Django Rest Framework
- Create a Notes Taking app in Django

I am Bijay Kumar, a Microsoft MVP in SharePoint. Apart from SharePoint, I started working on Python, Machine learning, and artificial intelligence for the last 5 years. During this time I got expertise in various Python libraries also like Tkinter, Pandas, NumPy, Turtle, Django, Matplotlib, Tensorflow, Scipy, Scikit-Learn, etc… for various clients in the United States, Canada, the United Kingdom, Australia, New Zealand, etc. Check out my profile.