1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
From: Michael Fladischer <FladischerMichael@fladi.at>
Date: Fri, 16 Oct 2015 12:26:16 +0200
Subject: Remove unnecessary dependency on dj_database_url.
Importing dj_database_url for a simple test application is not necessary,
replace the static database configuration with a default one from Django.
---
testapp/settings.py | 15 ++++-----------
1 file changed, 4 insertions(+), 11 deletions(-)
diff --git a/testapp/settings.py b/testapp/settings.py
index a803307..1f23cdd 100644
--- a/testapp/settings.py
+++ b/testapp/settings.py
@@ -11,20 +11,13 @@ NOSE_PLUGINS - Comma-separated list of plugins to add
from __future__ import print_function
from os import environ, path
-import dj_database_url
-
BASE_DIR = path.dirname(path.dirname(__file__))
-
-def rel_path(*subpaths):
- """Construct the full path given a relative path."""
- return path.join(BASE_DIR, *subpaths)
-
-
DATABASES = {
- 'default':
- dj_database_url.config(
- default='sqlite:///' + rel_path('testapp.sqlite3'))
+ 'default': {
+ 'ENGINE': 'django.db.backends.sqlite3',
+ 'NAME': path.join(BASE_DIR, 'testapp.sqlite3'),
+ }
}
MIDDLEWARE_CLASSES = ()
|