From 581563fa3574b29adbc4d05362fd9f5f784405c7 Mon Sep 17 00:00:00 2001 From: Saurabh Kumar Date: Sat, 25 Apr 2015 18:59:33 +0530 Subject: [PATCH] Make SECRET_KEY required in production and not in development --- .../{{cookiecutter.repo_name}}/config/common.py | 6 ------ .../{{cookiecutter.repo_name}}/config/production.py | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/config/common.py b/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/config/common.py index ba1da0f3..bb9cbb66 100644 --- a/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/config/common.py +++ b/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/config/common.py @@ -77,12 +77,6 @@ DEBUG = env.bool("DJANGO_DEBUG", False) # See: https://docs.djangoproject.com/en/dev/ref/settings/#template-debug TEMPLATE_DEBUG = DEBUG -# SECRET CONFIGURATION -# ------------------------------------------------------------------------------ -# See: https://docs.djangoproject.com/en/dev/ref/settings/#secret-key -# Raises ImproperlyConfigured exception if DJANO_SECRET_KEY not in os.environ -SECRET_KEY = env("DJANGO_SECRET_KEY") - # FIXTURE CONFIGURATION # ------------------------------------------------------------------------------ # See: https://docs.djangoproject.com/en/dev/ref/settings/#std:setting-FIXTURE_DIRS diff --git a/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/config/production.py b/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/config/production.py index 152265fc..5d28ac37 100644 --- a/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/config/production.py +++ b/{{cookiecutter.repo_name}}/{{cookiecutter.repo_name}}/config/production.py @@ -14,6 +14,12 @@ from boto.s3.connection import OrdinaryCallingFormat from .common import * # noqa +# SECRET CONFIGURATION +# ------------------------------------------------------------------------------ +# See: https://docs.djangoproject.com/en/dev/ref/settings/#secret-key +# Raises ImproperlyConfigured exception if DJANO_SECRET_KEY not in os.environ +SECRET_KEY = env("DJANGO_SECRET_KEY") + # This ensures that Django will be able to detect a secure connection # properly on Heroku. SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')