Update config

Source the configuration from an environment file, this way it is similar to how the aws environment works
This commit is contained in:
Rebecca Law
2016-02-16 15:25:46 +00:00
parent 7ff5f6c45a
commit 08ba5de61b
13 changed files with 69 additions and 132 deletions

15
wsgi.py
View File

@@ -1,17 +1,14 @@
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()
from app import create_app
from credstash import getAllSecrets
# on aws get secrets and export to env
secrets = getAllSecrets(region="eu-west-1")
for key, val in secrets.items():
os.environ[key] = val
application = create_app(config, secrets)
application = create_app()
if __name__ == "__main__":
application.run()