The MVT (Model View Template) is a software design pattern. It is a collection of three important components Model, View, and Template.
- The data guys and gals needed a common interface to be able to work with disparate data sources, formats, and database software
Models are like a set of tools that make working with data and databases much easier
- The hard-core coders needed a framework that allowed them to rapidly deploy changes within the system that kept everyone happy
Views is like a framework that handles communication between the user and the database and automates many of the painful parts of managing a complex website
Template in django is like a plain-text templating system that can be used by non-programmers
Model: Model is going to act as the interface of your data. It is responsible for maintaining data. It is the logical data structure behind the entire application and is represented by a database (generally relational databases such as MySql, Postgres).
Template: A template consists of static parts of the desired HTML output as well as some special syntax describing how dynamic content will be inserted.
See the following graph that shows the MVT based control flow.
Here, a user requests for a resource to the Django, Django works as a controller and check to the available resource in URL.
If URL maps, a view is called that interact with model and template, it renders a template.
Django responds back to the user and sends a template as a response.
So, there is no separate controller and complete application is based on Model View and Template. That’s why it is called MVT application.
The developer provides the Model, the view and the template then just maps it to a URL and Django does the magic to serve it to the user..