From 34c3e5db2a421e52795f8ffb4742305746a1995f Mon Sep 17 00:00:00 2001 From: nukeop Date: Thu, 29 Dec 2016 17:22:22 +0100 Subject: [PATCH] Load parameters from environment --- smash/__init__.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/smash/__init__.py b/smash/__init__.py index 6f078e5..d14dda5 100644 --- a/smash/__init__.py +++ b/smash/__init__.py @@ -23,6 +23,13 @@ if ('APPBRAND' in conf.config and 'APPBRAND' in os.environ): conf.add(('APPBRAND', os.environ['APPBRAND'])) +# Load admin key and secret key from environment +if 'ADMINSECRET' in os.environ: + conf.add(('ADMINSECRET', os.environ['ADMINSECRET'])) + +if 'SECRETKEY' in os.environ: + conf.add(('SECRETKEY', os.environ['SECRETKEY'])) + # Set the secret key if 'SECRETKEY' in conf.config: app.secret_key = conf.config['SECRETKEY']