Django Book 翻译
菜单>:
TOC
返回
原文:
* Within the ``current_datetime`` function, we still calculate ``now`` , but the template loading, context creation, template rendering, and ``HttpResponse`` creation is all taken care of by the ``render_to_response()`` call. Because ``render_to_response()`` returns an ``HttpResponse`` object, we can simply ``return`` that value in the view.
翻译:
* 在 ``current_datetime`` 函数中,我们仍然进行 ``now`` 计算,但模板加载、上下文创建、模板解析和 ``HttpResponse`` 创建工作均在对 ``render_to_response()`` 的调用中完成了。由于 ``render_to_response()`` 返回 ``HttpResponse`` 对象,因此我们仅需在视图中 ``return`` 该值。
备注:
译者: