mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-12 16:22:17 -05:00
13 lines
471 B
Python
13 lines
471 B
Python
import json
|
|
import os
|
|
|
|
|
|
def extract_cloudfoundry_config():
|
|
vcap_services = json.loads(os.environ['VCAP_SERVICES'])
|
|
|
|
# Postgres config
|
|
os.environ['SQLALCHEMY_DATABASE_URI'] = vcap_services['postgres'][0]['credentials']['uri'].replace('postgres',
|
|
'postgresql')
|
|
# Redis config
|
|
os.environ['REDIS_URL'] = vcap_services['redis'][0]['credentials']['uri']
|