Skip to content

Commit af451cd

Browse files
authored
added print warning if secret key env var not set.
1 parent 68d34b9 commit af451cd

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

config.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,11 @@
66

77
class Config:
88
APP_NAME = 'Flask-Base'
9-
SECRET_KEY = os.environ.get('SECRET_KEY') or \
10-
'SECRET_KEY_ENV_VAR_NOT_SET'
9+
if os.environ.get('SECRET_KEY'):
10+
SECRET_KEY = os.environ.get('SECRET_KEY')
11+
else:
12+
SECRET_KEY = 'SECRET_KEY_ENV_VAR_NOT_SET'
13+
print 'SECRET KEY ENV VAR NOT SET! SHOULD NOT SEE IN PRODUDCTION'
1114
SQLALCHEMY_COMMIT_ON_TEARDOWN = True
1215

1316
MAIL_SERVER = 'smtp.googlemail.com'

0 commit comments

Comments
 (0)