@@ -31,8 +31,6 @@ def get_bool(name, default):
31
31
32
32
DEBUG = get_bool ('DEBUG' , False )
33
33
34
- TEMPLATE_DEBUG = DEBUG
35
-
36
34
ADMINS = re .findall (r'\s*([^<]+) <([^>]+)>\s*' , os .getenv ('ADMINS' , '' ))
37
35
38
36
MANAGERS = ADMINS
@@ -79,12 +77,38 @@ def get_bool(name, default):
79
77
os .path .abspath (os .path .join (BASE_DIR , '..' , 'htdocs' , 'media' )),
80
78
)
81
79
82
- # List of callables that know how to import templates from various sources.
83
- TEMPLATE_LOADERS = (
84
- ('django.template.loaders.cached.Loader' , (
85
- 'django.template.loaders.app_directories.Loader' ,
86
- )),
87
- )
80
+
81
+ TEMPLATES = [{
82
+ 'BACKEND' : 'django.template.backends.django.DjangoTemplates' ,
83
+ 'DIRS' : [],
84
+ 'OPTIONS' : {
85
+ 'context_processors' : [
86
+ 'django.contrib.auth.context_processors.auth' ,
87
+ 'django.template.context_processors.debug' ,
88
+ 'django.template.context_processors.i18n' ,
89
+ 'django.template.context_processors.media' ,
90
+ 'django.template.context_processors.static' ,
91
+ 'django.template.context_processors.tz' ,
92
+ 'django.contrib.messages.context_processors.messages' ,
93
+ 'mygpo.web.google.analytics' ,
94
+ 'mygpo.web.google.adsense' ,
95
+ # make the debug variable available in templates
96
+ # https://docs.djangoproject.com/en/dev/ref/templates/api/#django-core-context-processors-debug
97
+ 'django.core.context_processors.debug' ,
98
+
99
+ # required so that the request obj can be accessed from
100
+ # templates. this is used to direct users to previous
101
+ # page after login
102
+ 'django.core.context_processors.request' ,
103
+ ],
104
+ 'loaders' : [
105
+ ('django.template.loaders.cached.Loader' , [
106
+ 'django.template.loaders.app_directories.Loader' ,
107
+ ]),
108
+ ],
109
+ },
110
+ }]
111
+
88
112
89
113
MIDDLEWARE_CLASSES = (
90
114
'django.middleware.common.CommonMiddleware' ,
@@ -97,8 +121,6 @@ def get_bool(name, default):
97
121
98
122
ROOT_URLCONF = 'mygpo.urls'
99
123
100
- TEMPLATE_DIRS = ()
101
-
102
124
INSTALLED_APPS = (
103
125
'django.contrib.contenttypes' ,
104
126
'django.contrib.messages' ,
@@ -171,21 +193,6 @@ def get_bool(name, default):
171
193
SESSION_SERIALIZER = 'django.contrib.sessions.serializers.PickleSerializer'
172
194
173
195
174
- from django .conf .global_settings import TEMPLATE_CONTEXT_PROCESSORS
175
-
176
- TEMPLATE_CONTEXT_PROCESSORS += (
177
- "mygpo.web.google.analytics" ,
178
- "mygpo.web.google.adsense" ,
179
-
180
- # make the debug variable available in templates
181
- # https://docs.djangoproject.com/en/dev/ref/templates/api/#django-core-context-processors-debug
182
- "django.core.context_processors.debug" ,
183
-
184
- # required so that the request obj can be accessed from templates.
185
- # this is used to direct users to previous page after login
186
- 'django.core.context_processors.request' ,
187
- )
188
-
189
196
MESSAGE_STORAGE = 'django.contrib.messages.storage.session.SessionStorage'
190
197
191
198
USER_CLASS = 'mygpo.users.models.User'
0 commit comments