Skip to content

Commit ff69f09

Browse files
committed
Remove duplication in database settings
1 parent 87258e4 commit ff69f09

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

gettingstarted/settings.py

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,10 @@
5959
# Database
6060
# https://docs.djangoproject.com/en/1.6/ref/settings/#databases
6161

62+
# Parse database configuration from $DATABASE_URL
63+
6264
DATABASES = {
63-
'default': {
64-
'ENGINE': 'django.db.backends.sqlite3',
65-
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
66-
}
65+
'default': dj_database_url.config(default='sqlite:///'+os.path.join(BASE_DIR, 'db.sqlite3'))
6766
}
6867

6968
# Internationalization
@@ -85,12 +84,6 @@
8584

8685
STATIC_URL = '/static/'
8786

88-
89-
# Parse database configuration from $DATABASE_URL
90-
db_config = dj_database_url.config()
91-
if db_config:
92-
DATABASES['default'] = db_config
93-
9487
# Honor the 'X-Forwarded-Proto' header for request.is_secure()
9588
SECURE_PROXY_SSL_HEADER = ('HTTP_X_FORWARDED_PROTO', 'https')
9689

0 commit comments

Comments
 (0)