From 24107a29af5f3e174a1cb28d41aac92a5fe66aff Mon Sep 17 00:00:00 2001 From: Lornah Lynn Tumuhairwe Date: Thu, 7 Sep 2017 15:59:47 +0300 Subject: [PATCH] ch(deployment): Edited heroku configs --- .gitignore | 2 +- hc/settings.py | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 36ad049..d697a59 100644 --- a/.gitignore +++ b/.gitignore @@ -3,7 +3,7 @@ __pycache__/ .coverage hc.sqlite static-collected - +hc/local_settings.py .DS_Store static/.DS_Store .vscode/ diff --git a/hc/settings.py b/hc/settings.py index b466888..9820cc0 100644 --- a/hc/settings.py +++ b/hc/settings.py @@ -149,9 +149,6 @@ PUSHBULLET_CLIENT_ID = None PUSHBULLET_CLIENT_SECRET = None -import dj_database_url -DATABASES['default'] = dj_database_url.config() - SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https') ALLOWED_HOSTS = ['*'] @@ -162,3 +159,13 @@ from .local_settings import * else: warnings.warn("local_settings.py not found, using defaults") + +if os.getcwd() == "/app": + from dj_database_url import parse + DATABASE_URL = os.getenv('DATABASE_URL') + DATABASES = { + "default": parse( + DATABASE_URL, + conn_max_age = 600 + ) + }