Django 为什么不叫MVC框架,官方给出了回答。

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

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值