Incorporate credstash in production wsgi scripts.

This commit is contained in:
Martyn Inglis
2016-01-10 21:33:04 +00:00
parent 3579a4ea94
commit 2c2d236e85
2 changed files with 9 additions and 1 deletions

View File

@@ -8,6 +8,7 @@ SQLAlchemy-Utils==0.30.5
Flask-WTF==0.11 Flask-WTF==0.11
Flask-Login==0.2.11 Flask-Login==0.2.11
Flask-Bcrypt==0.6.2 Flask-Bcrypt==0.6.2
credstash==1.8.0
git+https://github.com/alphagov/notify-api-client.git@0.1.4#egg=notify-api-client==0.1.4 git+https://github.com/alphagov/notify-api-client.git@0.1.4#egg=notify-api-client==0.1.4

View File

@@ -1,7 +1,14 @@
from app import create_app from app import create_app
import os import os
from credstash import getAllSecrets
application = create_app(os.getenv('NOTIFICATIONS_ADMIN_ENVIRONMENT') or 'development') secrets = getAllSecrets(region="eu-west-1")
application = create_app(os.getenv('NOTIFICATIONS_ADMIN_ENVIRONMENT') or 'live')
for key in application.config.keys():
if key in secrets:
application.config[key] = secrets[key]
if __name__ == "__main__": if __name__ == "__main__":
application.run() application.run()