diff --git a/{{cookiecutter.project_slug}}/config/settings/base.py b/{{cookiecutter.project_slug}}/config/settings/base.py index 6a6510db7..eab0129e2 100644 --- a/{{cookiecutter.project_slug}}/config/settings/base.py +++ b/{{cookiecutter.project_slug}}/config/settings/base.py @@ -308,6 +308,12 @@ ACCOUNT_ALLOW_REGISTRATION = env.bool("DJANGO_ACCOUNT_ALLOW_REGISTRATION", True) ACCOUNT_AUTHENTICATION_METHOD = "{{cookiecutter.username_type}}" # https://django-allauth.readthedocs.io/en/latest/configuration.html ACCOUNT_EMAIL_REQUIRED = True +{% if cookiecutter.username_type == "email" -%} +# https://django-allauth.readthedocs.io/en/latest/configuration.html +ACCOUNT_USERNAME_REQUIRED = False +# https://django-allauth.readthedocs.io/en/latest/configuration.html +ACCOUNT_USER_MODEL_USERNAME_FIELD = None +{% endif -%} # https://django-allauth.readthedocs.io/en/latest/configuration.html ACCOUNT_EMAIL_VERIFICATION = "mandatory" # https://django-allauth.readthedocs.io/en/latest/configuration.html