20170901 MTV and MVC patterns
Two MVC and MTV modeundefined
The famous MVC pattern: the so-called MVC is to divide Web applications into models (M), controllers (C), view (V) Three layers, and they are connected together in a plug-in, loosely coupled way.
The model is responsible for the business object with the database object (ORM), the view is responsible for interacting with the user (page), the controller (C) accepts the user's input call model and the view completes the user's request.
The Django MTV model is essentially no different from the MVC pattern, and it's just a little different from the definition of each component in order to remain loosely coupled, as Django's MTV represents:
Model: Object that is responsible for business objects and databases (ORM)
Template (Template): Responsible for how to display the page to the user
View: Responsible for business logic, and call model and template when appropriate
In addition, Django has a URL dispatcher that distributes page requests for URLs to different view processes, and then calls the corresponding model and template
20170901 MTV and MVC patterns