diff --git a/cookiecutter.json b/cookiecutter.json index 90d084b3a..ccdd0f174 100644 --- a/cookiecutter.json +++ b/cookiecutter.json @@ -5,6 +5,7 @@ "author_name": "Daniel Roy Greenfeld", "domain_name": "example.com", "email": "{{ cookiecutter.author_name.lower()|replace(' ', '-') }}@example.com", + "username_type": ["username", "email"], "version": "0.1.0", "open_source_license": [ "MIT", diff --git a/{{cookiecutter.project_slug}}/config/settings/base.py b/{{cookiecutter.project_slug}}/config/settings/base.py index 9cd6a081b..6a6510db7 100644 --- a/{{cookiecutter.project_slug}}/config/settings/base.py +++ b/{{cookiecutter.project_slug}}/config/settings/base.py @@ -305,7 +305,7 @@ CELERY_BEAT_SCHEDULER = "django_celery_beat.schedulers:DatabaseScheduler" # ------------------------------------------------------------------------------ ACCOUNT_ALLOW_REGISTRATION = env.bool("DJANGO_ACCOUNT_ALLOW_REGISTRATION", True) # https://django-allauth.readthedocs.io/en/latest/configuration.html -ACCOUNT_AUTHENTICATION_METHOD = "username" +ACCOUNT_AUTHENTICATION_METHOD = "{{cookiecutter.username_type}}" # https://django-allauth.readthedocs.io/en/latest/configuration.html ACCOUNT_EMAIL_REQUIRED = True # https://django-allauth.readthedocs.io/en/latest/configuration.html diff --git a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/base.html b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/base.html index 58aca7208..74f8ebe27 100644 --- a/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/base.html +++ b/{{cookiecutter.project_slug}}/{{cookiecutter.project_slug}}/templates/base.html @@ -82,7 +82,7 @@ {% if request.user.is_authenticated %}