Files
notifications-admin/wsgi.py

25 lines
579 B
Python
Raw Normal View History

from credstash import getAllSecrets
2016-04-21 11:19:22 +01:00
import os
default_env_file = '/home/ubuntu/environment'
environment = 'live'
if os.path.isfile(default_env_file):
with open(default_env_file, 'r') as environment_file:
environment = environment_file.readline().strip()
2016-04-21 11:19:22 +01:00
# on aws get secrets and export to env
os.environ.update(getAllSecrets(region="eu-west-1"))
2016-04-21 11:19:22 +01:00
from config import configs # noqa
os.environ['NOTIFY_ADMIN_ENVIRONMENT'] = configs[environment]
2016-04-21 11:19:22 +01:00
from app import create_app # noqa
application = create_app()
if __name__ == "__main__":
2015-12-03 09:40:28 +00:00
application.run()