From eaf37ea29c90ef404a29eb21d4b37120b0d4a1c2 Mon Sep 17 00:00:00 2001 From: Martyn Inglis Date: Tue, 9 Feb 2016 13:53:04 +0000 Subject: [PATCH] Updated wsgi so that it can read the environment from the files present on AWS instances --- wsgi.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/wsgi.py b/wsgi.py index 138a48c6f..fd773b3e0 100644 --- a/wsgi.py +++ b/wsgi.py @@ -1,9 +1,17 @@ from app import create_app from credstash import getAllSecrets +import os + +config = 'live' +default_env_file = '/home/ubuntu/environment' + +if os.path.isfile(default_env_file): + environment = open(default_env_file, 'r') + config = environment.readline().strip() secrets = getAllSecrets(region="eu-west-1") -application = create_app('live', secrets) +application = create_app(config, secrets) if __name__ == "__main__": application.run()