From 6f1b92d4e4440c81e5881ff8bae0d2182f982966 Mon Sep 17 00:00:00 2001 From: Tyler Hallada Date: Mon, 28 Jul 2014 19:19:40 -0400 Subject: [PATCH] Put SECRET_KEY into environ on heroku --- laundry/settings.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/laundry/settings.py b/laundry/settings.py index 9f14498..888c828 100644 --- a/laundry/settings.py +++ b/laundry/settings.py @@ -3,7 +3,7 @@ import os try: import secrets except ImportError: - print "No secrets.py add it or set DATABASES in settings.py manually." + print "No secrets.py add it or set DATABASES and SECRET_KEY in settings.py manually." pass # this occur only while on heroku DEBUG = True @@ -104,7 +104,10 @@ STATICFILES_FINDERS = ( ) # Make this unique, and don't share it with anybody. -SECRET_KEY = secrets.SECRET_KEY +try: + SECRET_KEY = secrets.SECRET_KEY +except NameError: # if on heroku and there is no secrets file + SECRET_KEY = os.environ.get('SECRET_KEY') # List of callables that know how to import templates from various sources. TEMPLATE_LOADERS = (