Django Book 翻译
菜单>:
TOC
返回
原文:
``RequestContext`` and **context processors** were created to solve this problem. Context processors let you specify a number of variables that get set in each context automatically without you having to specify the variables in each ``render_to_response()`` call. The catch is that you have to use ``RequestContext`` instead of ``Context`` when you render a template.
翻译:
创建 ``RequestContext`` 和 **context处理器** 就是为了解决这个问题。Context处理器允许你设置一些变量,它们会在每个context中自动被设置好,而不必每次调用 ``render_to_response()`` 时都指定。要点就是,当你渲染模板时,你要用 ``RequestContext`` 而不是 ``Context`` 。
备注:
译者: