From 2ab8bd241b6c467c21efac270043e3698f4017c2 Mon Sep 17 00:00:00 2001 From: Gergely Polonkai Date: Wed, 21 Oct 2015 09:57:59 +0200 Subject: [PATCH] Fix settings.py so it works fine in a local dev environment --- duckbook/settings.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/duckbook/settings.py b/duckbook/settings.py index a5d0825..ace4077 100644 --- a/duckbook/settings.py +++ b/duckbook/settings.py @@ -59,7 +59,7 @@ WSGI_APPLICATION = 'duckbook.wsgi.application' # Database # https://docs.djangoproject.com/en/1.7/ref/settings/#databases -os.environ.setdefault('DATABASE_URL', 'sqlite://' + os.path.join(BASE_DIR, 'db.sqlite3')) +os.environ.setdefault('DATABASE_URL', 'sqlite:///' + os.path.join(BASE_DIR, 'db.sqlite3')) DATABASES = { 'default': dj_database_url.config() } @@ -84,9 +84,10 @@ USE_TZ = True STATIC_URL = '/static/' STATIC_ROOT = 'static' -STATICFILES_DIRS = ( - os.path.join(BASE_DIR, 'static'), -) +if STATIC_ROOT != 'static': + STATICFILES_DIRS = ( + os.path.join(BASE_DIR, 'static'), + ) TEST_RUNNER = 'junorunner.testrunner.TestSuiteRunner'