1 class RequestContext(Context): 2 """ 3 This subclass of template.Context automatically populates itself using 4 the processors defined in TEMPLATE_CONTEXT_PROCESSORS. 5 Additional processors can be specified as a list of callables 6 using the "processors" keyword argument. 7 """ 8 def __init__(self, request, dict_=None, processors=None, current_app=None, 9 use_l10n=None, use_tz=None): 10 Context.__init__(self, dict_, current_app=current_app, 11 use_l10n=use_l10n, use_tz=use_tz) 12 if processors is None: 13 processors = () 14 else: 15 processors = tuple(processors) 16 for processor in get_standard_processors() + processors: 17 self.update(processor(request))
是从render 跟到这里来的
context_instance = RequestContext(request, current_app=current_app)
注释:
时间: 2024-11-08 11:41:39