2016-04-21 09:30:33 +01:00
|
|
|
from credstash import getAllSecrets
|
2016-12-08 16:50:37 +00:00
|
|
|
from whitenoise import WhiteNoise
|
2016-04-21 11:19:22 +01:00
|
|
|
import os
|
2016-04-21 09:30:33 +01:00
|
|
|
|
2016-12-08 16:50:37 +00:00
|
|
|
# On AWS get secrets and export to env, skip this on Cloud Foundry
|
|
|
|
|
if os.getenv('VCAP_SERVICES') is None:
|
|
|
|
|
os.environ.update(getAllSecrets(region="eu-west-1"))
|
2016-03-17 13:45:59 +00:00
|
|
|
|
2016-04-21 11:19:22 +01:00
|
|
|
from app import create_app # noqa
|
|
|
|
|
|
2016-12-08 16:50:37 +00:00
|
|
|
PROJECT_ROOT = os.path.dirname(os.path.abspath(__file__))
|
|
|
|
|
STATIC_ROOT = os.path.join(PROJECT_ROOT, 'app', 'static')
|
|
|
|
|
STATIC_URL = 'static/'
|
|
|
|
|
|
|
|
|
|
application = WhiteNoise(create_app(), STATIC_ROOT, STATIC_URL)
|
2016-01-10 21:53:41 +00:00
|
|
|
|
2015-12-03 09:38:02 +00:00
|
|
|
if __name__ == "__main__":
|
2015-12-03 09:40:28 +00:00
|
|
|
application.run()
|