From 452009107dd15d8c7dd578998518f0264f6c0d74 Mon Sep 17 00:00:00 2001 From: Andrew Chen Wang <60190294+Andrew-Chen-Wang@users.noreply.github.com> Date: Sat, 26 Nov 2022 16:45:56 -0500 Subject: [PATCH] Handle signup --- {{cookiecutter.project_slug}}/config/settings/base.py | 6 ++++++ 1 file changed, 6 insertions(+) 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