Django authentication best practice

28 views
Skip to first unread message

mmk mmk

unread,
Nov 20, 2019, 11:50:01 AM11/20/19
to Django users
I want to replace django default username and password authentication with email and password authentication,
i have many solution like extends Abstractbaseuser or using 3rd part like django-allauth .
My question now which is best practice to using to do this?

Yoo

unread,
Nov 21, 2019, 5:56:17 AM11/21/19
to Django users
Whenever I deploy an app, I always use cookiecutter-django. I’m pretty sure there is an option lying somewhere in the settings that let you disable username. If not, I believe the BaseUser model has the option of the unique identifier or username be set to the email itself.

Otherwise, you can do what you said, which is abstractbaseuser model. Or you can setup a manager class. Check the Django source code for a little more insight.
Reply all
Reply to author
Forward
0 new messages