From 96a4ae33b506fce8a417bb656a6bf5af84066f13 Mon Sep 17 00:00:00 2001 From: Eraldo Energy Date: Tue, 16 Feb 2016 18:53:37 +0100 Subject: [PATCH 1/3] Environment aware registration switch setting The status of the registration (open or closed) is now read from the project environment instead of hardcoded in the common settings file. --- {{cookiecutter.repo_name}}/config/settings/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 From 22acc55bccdcb548c9de49ce9472b0d882ae08fc Mon Sep 17 00:00:00 2001 From: Eraldo Energy Date: Tue, 16 Feb 2016 19:07:20 +0100 Subject: [PATCH 2/3] Update settings.rst --- docs/settings.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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) From c7627f4c54055e3f3f4fb05720fcea7dca6a52de Mon Sep 17 00:00:00 2001 From: Eraldo Energy Date: Thu, 18 Feb 2016 00:46:45 +0100 Subject: [PATCH 3/3] Added account registration switch to env example --- {{cookiecutter.repo_name}}/env.example | 1 + 1 file changed, 1 insertion(+) 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 %}