Skip to content

Commit 979c5d2

Browse files
committed
Use dj_database_url for DATABASE setting
1 parent d960ff9 commit 979c5d2

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

tutorial/settings.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"""
1212

1313
import os
14+
import dj_database_url
1415

1516
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
1617
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
@@ -73,10 +74,10 @@
7374
# https://docs.djangoproject.com/en/1.11/ref/settings/#databases
7475

7576
DATABASES = {
76-
'default': {
77-
'ENGINE': 'django.db.backends.sqlite3',
78-
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
79-
}
77+
'default':
78+
dj_database_url.config(
79+
default='sqlite:///{}'.format(os.path.join(BASE_DIR, 'db.sqlite3'))
80+
)
8081
}
8182

8283
# Password validation

0 commit comments

Comments
 (0)