From 667317a7bbf446f261bf9632224d857a6d32f47e Mon Sep 17 00:00:00 2001 From: Swen Kooij Date: Fri, 21 Oct 2016 13:58:33 +0300 Subject: [PATCH] Use dj-database-url for configuring db access --- requirements/test.txt | 1 + settings.py | 8 +++----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/requirements/test.txt b/requirements/test.txt index e3be669..142530c 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -12,3 +12,4 @@ coverage==4.2 django-coverage-plugin==1.3.1 flake8==3.0.4 pep8==1.7.0 +dj-database-url==0.4.1 diff --git a/settings.py b/settings.py index d16a02b..bcde5c7 100644 --- a/settings.py +++ b/settings.py @@ -1,3 +1,5 @@ +import dj_database_url + DEBUG = True TEMPLATE_DEBUG = True @@ -6,11 +8,7 @@ SECRET_KEY = 'this is my secret key' TEST_RUNNER = 'django.test.runner.DiscoverRunner' DATABASES = { - 'default': { - 'ENGINE': 'django.db.backends.postgresql', - 'NAME': 'localized_fields', - 'HOST': 'localhost' - } + 'default': dj_database_url.config(default='postgres:///localized_fields') } LANGUAGE_CODE = 'en'