Skip to content

Commit 8365d72

Browse files
authored
Merge pull request #248 from jberends/master
Refactored demo.settings to use TEMPLATE dictionary settings for django
2 parents f07429c + 8949b1f commit 8365d72

File tree

1 file changed

+18
-15
lines changed

1 file changed

+18
-15
lines changed

demo/demo/settings.py

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010

1111
# Build paths inside the project like this: os.path.join(BASE_DIR, ...)
1212
import os
13-
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
1413

14+
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
1515

1616
# Quick-start development settings - unsuitable for production
1717
# See https://docs.djangoproject.com/en/1.7/howto/deployment/checklist/
@@ -22,19 +22,8 @@
2222
# SECURITY WARNING: don't run with debug turned on in production!
2323
DEBUG = True
2424

25-
TEMPLATE_DEBUG = True
26-
2725
ALLOWED_HOSTS = []
2826

29-
TEMPLATE_CONTEXT_PROCESSORS = (
30-
'django.contrib.auth.context_processors.auth',
31-
"django.core.context_processors.request",
32-
33-
# Disabling due to alluth>=0.21.0 changes
34-
# "allauth.account.context_processors.account",
35-
# "allauth.socialaccount.context_processors.socialaccount",
36-
)
37-
3827
# Application definition
3928

4029
INSTALLED_APPS = (
@@ -71,7 +60,6 @@
7160

7261
WSGI_APPLICATION = 'demo.wsgi.application'
7362

74-
7563
# Database
7664
# https://docs.djangoproject.com/en/1.7/ref/settings/#databases
7765

@@ -95,13 +83,28 @@
9583

9684
USE_TZ = True
9785

98-
9986
# Static files (CSS, JavaScript, Images)
10087
# https://docs.djangoproject.com/en/1.7/howto/static-files/
10188

10289
STATIC_URL = '/static/'
10390

104-
TEMPLATE_DIRS = [os.path.join(BASE_DIR, 'templates')]
91+
# TEMPLATE_DIRS = [os.path.join(BASE_DIR, 'templates')]
92+
93+
TEMPLATES = [
94+
{
95+
'BACKEND': 'django.template.backends.django.DjangoTemplates',
96+
'DIRS': [os.path.join(BASE_DIR, 'templates'), ],
97+
'APP_DIRS': True,
98+
'OPTIONS': {
99+
'context_processors': [
100+
'django.template.context_processors.debug',
101+
'django.template.context_processors.request',
102+
'django.contrib.auth.context_processors.auth',
103+
'django.contrib.messages.context_processors.messages',
104+
],
105+
},
106+
},
107+
]
105108

106109
REST_SESSION_LOGIN = False
107110
EMAIL_BACKEND = 'django.core.mail.backends.console.EmailBackend'

0 commit comments

Comments
 (0)