From a05d92ceadd418304379fb92a0a71abb924ee424 Mon Sep 17 00:00:00 2001 From: pwhipp Date: Thu, 10 Jul 2014 16:26:10 +1000 Subject: [PATCH] Added settings/includes/secrets.py facility for site specific secret data that should not be in the repo. --- mayan/settings/includes/common.py | 8 +++++--- mayan/settings/includes/secrets.py.example | 2 ++ 2 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 mayan/settings/includes/secrets.py.example diff --git a/mayan/settings/includes/common.py b/mayan/settings/includes/common.py index 7ae1e39808..4e69ec92f9 100644 --- a/mayan/settings/includes/common.py +++ b/mayan/settings/includes/common.py @@ -11,6 +11,7 @@ https://docs.djangoproject.com/en/1.6/ref/settings/ # Build paths inside the project like this: os.path.join(BASE_DIR, ...) import os import sys +from django.core.exceptions import ImproperlyConfigured ugettext = lambda s: s @@ -22,13 +23,14 @@ sys.path.append(os.path.join(BASE_DIR, 'mayan', 'apps')) STATIC_URL = '/static/' STATIC_ROOT = os.path.join(BASE_DIR, 'static_collected') +try: + from .secrets import * +except ImportError: + raise ImproperlyConfigured('You need a secrets.py file - use secrets.py.example for development') # Quick-start development settings - unsuitable for production # See https://docs.djangoproject.com/en/1.6/howto/deployment/checklist/ -# SECURITY WARNING: keep the secret key used in production secret! -SECRET_KEY = 'om^a(i8^6&h+umbd2%pt91cj!qu_@oztw117rgxmn(n2lp^*c!' - # SECURITY WARNING: don't run with debug turned on in production! DEBUG = True diff --git a/mayan/settings/includes/secrets.py.example b/mayan/settings/includes/secrets.py.example new file mode 100644 index 0000000000..285178747d --- /dev/null +++ b/mayan/settings/includes/secrets.py.example @@ -0,0 +1,2 @@ +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = 'Ei5lo4oh zooW4xaj ic6Uehaa Vahy2zae seej1OhK iwoh3ziX gai3Ohng Igh3phae'