Django appears to be a MVC framework, but you call the Controller the “view”, and the View the “template”. How come you don’t use the standard names?¶
Well, the standard names are debatable.
In our interpretation of MVC, the “view” describes the data that gets presented to the user. It’s not necessarily how the data looks, but which data is presented. The view describes which data you see, not how you see it. It’sa subtle distinction.
So, in our case, a “view” is the Python callback function for a particular URL,because that callback function describes which data is presented.
Furthermore, it’s sens

Django将“视图”定义为描述呈现给用户的数据显示的Python回调函数,而“模板”负责数据的呈现方式。控制器则可能指框架本身,根据Django的URL配置来调度请求。Django有时被称为MTV框架,即模型、模板和视图。
最低0.47元/天 解锁文章
1595

被折叠的 条评论
为什么被折叠?



