From cffee02043a9fba30dc9086c4aed86f7988fdc7a Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Sat, 26 Nov 2016 15:34:47 +0000 Subject: [PATCH] Use dj_database_url properly --- project/settings.py | 10 +--------- requirements.txt | 1 + 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/project/settings.py b/project/settings.py index f74f5bf..eafd349 100755 --- a/project/settings.py +++ b/project/settings.py @@ -98,16 +98,8 @@ WSGI_APPLICATION = 'project.wsgi.application' # Database # https://docs.djangoproject.com/en/1.10/ref/settings/#databases -if 'DATABASE_URL' in os.environ: - DATABASE_CONFIG = dj_database_url.config(default=os.environ['DATABASE_URL'], conn_max_age=300) -else: - DATABASE_CONFIG = { - 'ENGINE': 'django.db.backends.sqlite3', - 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'), - } - DATABASES = { - 'default': DATABASE_CONFIG + 'default': dj_database_url.config(default="sqlite:///{}/db.sqlite3".format(BASE_DIR), conn_max_age=300) } diff --git a/requirements.txt b/requirements.txt index 13dc761..cb8eed8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,6 +3,7 @@ dj_database_url==0.4.1 Django>=1.10,<1.11 flake8==3.2.1 honcho==0.7.1 +psycopg2==2.6.2 pygments-style-github==0.4 wagtail>=1.7,<1.8 waitress==1.0.1