Put SECRET_KEY into environ on heroku

This commit is contained in:
Tyler Hallada 2014-07-28 19:19:40 -04:00
parent 499140dd8f
commit 6f1b92d4e4

View File

@ -3,7 +3,7 @@ import os
try: try:
import secrets import secrets
except ImportError: 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 pass # this occur only while on heroku
DEBUG = True DEBUG = True
@ -104,7 +104,10 @@ STATICFILES_FINDERS = (
) )
# Make this unique, and don't share it with anybody. # 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. # List of callables that know how to import templates from various sources.
TEMPLATE_LOADERS = ( TEMPLATE_LOADERS = (