How can I reset the username in Django if I mistakenly set it wrong?

41 Views Asked by At

Is it possible to reset the superusername in Django if it was mistakenly set incorrectly? I made an error during the initial setup and need guidance on how to rectify it. What steps can be taken to change or reset the username in Django to ensure accuracy and consistency with the intended information?

I want the solution for reset the superusername n in Django

2

There are 2 best solutions below

0
Farhad Dorod On

Yes, it is possible.

You can manually update the auth_user table in your database. Open a database client and execute a SQL command to update the username:

UPDATE auth_user SET username = '<new_username>' WHERE username = '<old_username>';
0
Emil Chmielewski On

You can do it in admin panel by clicking on Users table, next you click on your misnamed superuser and in username field type your new name. Remember to save your change at the bottom of the site.