mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-18 13:38:53 -04:00
Properly set database connection string in cloud.gov
This commit is contained in:
@@ -14,6 +14,10 @@ class CloudfoundryConfig:
|
||||
'region': ''
|
||||
}
|
||||
|
||||
@property
|
||||
def database_url(self):
|
||||
return os.environ.get('DATABASE_URL', '').replace('postgres://', 'postgresql://')
|
||||
|
||||
@property
|
||||
def redis_url(self):
|
||||
try:
|
||||
|
||||
@@ -87,7 +87,7 @@ class Config(object):
|
||||
ROUTE_SECRET_KEY_2 = os.environ.get('ROUTE_SECRET_KEY_2', 'dev-route-secret-key-2')
|
||||
|
||||
# DB settings
|
||||
SQLALCHEMY_DATABASE_URI = os.environ.get('SQLALCHEMY_DATABASE_URI')
|
||||
SQLALCHEMY_DATABASE_URI = cloud_config.database_url
|
||||
SQLALCHEMY_RECORD_QUERIES = False
|
||||
SQLALCHEMY_TRACK_MODIFICATIONS = False
|
||||
SQLALCHEMY_POOL_SIZE = int(os.environ.get('SQLALCHEMY_POOL_SIZE', 5))
|
||||
|
||||
Reference in New Issue
Block a user