mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-09 15:09:48 -04:00
Merge pull request #485 from alphagov/update-requirements
Fix order of imports on wsgi
This commit is contained in:
11
wsgi.py
11
wsgi.py
@@ -1,9 +1,5 @@
|
|||||||
import os
|
|
||||||
|
|
||||||
from credstash import getAllSecrets
|
from credstash import getAllSecrets
|
||||||
|
import os
|
||||||
from app import create_app
|
|
||||||
from config import configs
|
|
||||||
|
|
||||||
default_env_file = '/home/ubuntu/environment'
|
default_env_file = '/home/ubuntu/environment'
|
||||||
environment = 'live'
|
environment = 'live'
|
||||||
@@ -12,11 +8,16 @@ if os.path.isfile(default_env_file):
|
|||||||
with open(default_env_file, 'r') as environment_file:
|
with open(default_env_file, 'r') as environment_file:
|
||||||
environment = environment_file.readline().strip()
|
environment = environment_file.readline().strip()
|
||||||
|
|
||||||
|
|
||||||
# on aws get secrets and export to env
|
# on aws get secrets and export to env
|
||||||
os.environ.update(getAllSecrets(region="eu-west-1"))
|
os.environ.update(getAllSecrets(region="eu-west-1"))
|
||||||
|
|
||||||
|
from config import configs # noqa
|
||||||
|
|
||||||
os.environ['NOTIFY_ADMIN_ENVIRONMENT'] = configs[environment]
|
os.environ['NOTIFY_ADMIN_ENVIRONMENT'] = configs[environment]
|
||||||
|
|
||||||
|
from app import create_app # noqa
|
||||||
|
|
||||||
application = create_app()
|
application = create_app()
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
Reference in New Issue
Block a user