Search code examples
django-registrationdjango-allauth

Does django-allauth provide a simple email/password method to replace the username/password method of django


Does django-allauth provide a basic way of using email/password instead of using the default username/password of Django? (without the need of having a social account)

On this tutorial, http://www.sarahhagstrom.com/2013/09/the-missing-django-allauth-tutorial/#Now_we_can_login_using_Django_or_Facebook, after he set up "Facebook", you see that the basic method is still by username.

django-registration-email has been discontinued due to the give-up of django-registration and they mention to look at django-allauth but I do not see whether you can replace the default django username/password method with only an email/password like this app was doing.


Solution

  • Yes, I'm doing exactly what you asked and it works. I use Allauth without using social account and login with email/password.

    The settings for what you want are:

    ACCOUNT_AUTHENTICATION_METHOD = "email"
    ACCOUNT_EMAIL_REQUIRED = True
    ACCOUNT_USERNAME_REQUIRED = False
    

    The username is still internally created but it can be totally transparent to the user.