码迷,mamicode.com
首页 > 其他好文 > 详细

Django源码分析——context.py

时间:2015-09-08 08:26:28      阅读:166      评论:0      收藏:0      [点我收藏+]

标签:

 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)

注释:

 

Django源码分析——context.py

标签:

原文地址:http://www.cnblogs.com/IDomyself/p/4790499.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!