Fix order of imports on wsgi

This commit is contained in:
Rebecca Law
2016-04-21 11:19:22 +01:00
parent 87704c3166
commit 5c3683ae86

11
wsgi.py
View File

@@ -1,9 +1,5 @@
import os
from credstash import getAllSecrets
from app import create_app
from config import configs
import os
default_env_file = '/home/ubuntu/environment'
environment = 'live'
@@ -12,11 +8,16 @@ if os.path.isfile(default_env_file):
with open(default_env_file, 'r') as environment_file:
environment = environment_file.readline().strip()
# on aws get secrets and export to env
os.environ.update(getAllSecrets(region="eu-west-1"))
from config import configs # noqa
os.environ['NOTIFY_ADMIN_ENVIRONMENT'] = configs[environment]
from app import create_app # noqa
application = create_app()
if __name__ == "__main__":