diff --git a/docs/settings.rst b/docs/settings.rst index c253c18c..768ff618 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -27,7 +27,7 @@ DJANGO_EMAIL_SUBJECT_PREFIX EMAIL_SUBJECT_PREFIX n/a DJANGO_ALLOWED_HOSTS ALLOWED_HOSTS ['*'] ['your_domain_name'] ======================================= =========================== ============================================== ====================================================================== -The following table lists settings and their defaults for third-party applications, which may or may be part of your project: +The following table lists settings and their defaults for third-party applications, which may or may not be part of your project: ======================================= =========================== ============================================== ====================================================================== Environment Variable Django Setting Development Default Production Default @@ -47,9 +47,9 @@ DJANGO_OPBEAT_SECRET_TOKEN OPBEAT['SECRET_TOKEN'] n/a DJANGO_OPBEAT_ORGANIZATION_ID OPBEAT['ORGANIZATION_ID'] n/a raises error ======================================= =========================== ============================================== ====================================================================== --------------- -Other Settings --------------- +-------------------------- +Other Environment Settings +-------------------------- -ACCOUNT_ALLOW_REGISTRATION (=True) - Allow enable or disable user registration through `django-allauth` without disabling other characteristics like authentication and account management. +DJANGO_ACCOUNT_ALLOW_REGISTRATION (=True) + Allow enable or disable user registration through `django-allauth` without disabling other characteristics like authentication and account management. (Django Setting: ACCOUNT_ALLOW_REGISTRATION) diff --git a/{{cookiecutter.repo_name}}/config/settings/common.py b/{{cookiecutter.repo_name}}/config/settings/common.py index 0a5deebe..57e88765 100644 --- a/{{cookiecutter.repo_name}}/config/settings/common.py +++ b/{{cookiecutter.repo_name}}/config/settings/common.py @@ -213,7 +213,7 @@ ACCOUNT_EMAIL_REQUIRED = True ACCOUNT_EMAIL_VERIFICATION = 'mandatory' ACCOUNT_ADAPTER = '{{cookiecutter.repo_name}}.users.adapter.AccountAdapter' SOCIALACCOUNT_ADAPTER = '{{cookiecutter.repo_name}}.users.adapter.SocialAccountAdapter' -ACCOUNT_ALLOW_REGISTRATION = True +ACCOUNT_ALLOW_REGISTRATION = env.bool("DJANGO_ACCOUNT_ALLOW_REGISTRATION", True) # Custom user app defaults # Select the correct user model diff --git a/{{cookiecutter.repo_name}}/env.example b/{{cookiecutter.repo_name}}/env.example index 7eae951c..85c96d3c 100644 --- a/{{cookiecutter.repo_name}}/env.example +++ b/{{cookiecutter.repo_name}}/env.example @@ -12,6 +12,7 @@ DJANGO_MAILGUN_API_KEY= DJANGO_MAILGUN_SERVER_NAME= DJANGO_SERVER_EMAIL= DJANGO_SECURE_SSL_REDIRECT=False +DJANGO_ACCOUNT_ALLOW_REGISTRATION=True {% if cookiecutter.use_sentry == 'y' -%} DJANGO_SENTRY_DSN= {% endif %}