Can't login with Username

37 views
Skip to first unread message

Sudip Khokhar

unread,
Jun 13, 2022, 9:39:04 AM6/13/22
to Django users
Hi All,

I am practicing Django since 3 months and recently I encountered an issue with my practice project as I made a super user and didn't added email to it.
Then after I set email as the USERNAME_FIELD = 'email' in my django model to access the database. But not I don't know how to add email after making migrations to it.
I had also tried by commenting USERNAME_FIELD = 'email' and REQUIRED_FIELDS = [], but didn't worked well and I'm unable to login to my django admin database.

Abdul Qoyyuum

unread,
Jun 13, 2022, 9:13:15 PM6/13/22
to Django users
Create another superuser with 

python manage.py createsuperuser --username=joe --email=j...@example.com

And then, login with joe and your new password.

Ryan Nowakowski

unread,
Jun 16, 2022, 6:41:07 PM6/16/22
to django...@googlegroups.com, Sudip Khokhar
You could use manage.py shell to set the email address of your super user.
Reply all
Reply to author
Forward
0 new messages