3

我正在尝试阅读 django 的权威指南。但是我感觉不到“渲染”这个词,我在书中遇到了模板章节。作者从未提及它的含义,即使我已经阅读了介绍性模板章节。

在英文词典中,render 是

to cause to be or become; make: to render someone helpless.

但这在 django 中没有意义(当然,我无法理解这一点,因为我使用英语作为第二语言。

你能给出“渲染”这个词的定义吗?谢谢你。

4

3 回答 3

4

Sense 7,转换模板并提供变量以呈现给用户。

于 2013-02-10T10:02:53.060 回答
2

在 django 中,模板被渲染为 HTTPResponse。即模板被解释并翻译成适当的输出。在 django 中,模板可以呈现为 http 响应 ( render_to_response) 或字符串 ( render_to_string)。

我的字典中很少有相关的英语单词含义是

render:
    give an interpretation or rendition of 
        The pianist rendered the Beethoven sonata beautifully
    restate (words) from one language into another language
        She rendered the French poem into English
于 2013-02-10T10:04:26.870 回答
-1

合并您的模板和代码以创建适当的页面

于 2020-07-31T20:17:13.583 回答