MVC pattern in django

2019-02-13 21:49发布

This issue has been tormenting me for a while already. I've read about this topic but nothing seems to clear my thoughts. I understand that they call the views templates, and the models models as well, what I don't really get is where the controllers are. What django calls views seem to me more like actions/methods/functions of a controller than a controller itself, but anywhere I read, I find that supposed view-controller equivalency.

I've worked with MVC frameworks before (ASP.NET MVC3, Ruby on Rails, PHP Laravel Framework), and they all define the controllers as the same thing: a bunch of functions related to a specific topic of the site, namely user accounts or something like that. The best equivalency that I find between this description and django features are the apps, but of course I'm wrong due to the huge amount of people and documentation going the other way.

Could anybody help me with this? Does my mindset make any sense? Am I missing something essential here and then I can't get these concepts right?

7条回答
别忘想泡老子
2楼-- · 2019-02-13 22:53

The mismatch of terminology is unfortunate but more or less doing the same thing.

查看更多
登录 后发表回答