@@ -228,6 +228,25 @@ def push_state(self, template, isolated_context=True):
228
228
self .pop ()
229
229
230
230
231
+ from django .utils .module_loading import import_string
232
+ _standard_context_processors = None
233
+
234
+ # This is a function rather than module-level procedural code because we only
235
+ # want it to execute if somebody uses RequestContext.
236
+ def get_standard_processors ():
237
+ from django .conf import settings
238
+ global _standard_context_processors
239
+ if _standard_context_processors is None :
240
+ processors = []
241
+ collect = []
242
+ collect .extend (_builtin_context_processors )
243
+ collect .extend (settings .GTEMPLATE_CONTEXT_PROCESSORS )
244
+ for path in collect :
245
+ func = import_string (path )
246
+ processors .append (func )
247
+ _standard_context_processors = tuple (processors )
248
+ return _standard_context_processors
249
+
231
250
class RequestContext (Context ):
232
251
"""
233
252
This subclass of template.Context automatically populates itself using
@@ -242,12 +261,18 @@ def __init__(self, request, dict_=None, processors=None, use_l10n=None, use_tz=N
242
261
self ._processors = () if processors is None else tuple (processors )
243
262
self ._processors_index = len (self .dicts )
244
263
264
+ updates = dict ()
265
+ #@TODO@ Prakash to Implement context processor
266
+ for processor in get_standard_processors ():
267
+ updates .update (processor (request ))
268
+ self .update (updates )
269
+
245
270
# placeholder for context processors output
246
- self .update ({})
271
+ # self.update({})
247
272
248
273
# empty dict for any new modifications
249
274
# (so that context processors don't overwrite them)
250
- self .update ({})
275
+ # self.update({})
251
276
252
277
@contextmanager
253
278
def bind_template (self , template ):
0 commit comments