PYTHON-DJANGO MVT Pattern
The MVT (Model View Template) is a software design pattern. It is a combination of Model, View
Django is referred to as an MTV framework. In MTV,
- M – “Model,” the data access layer. This layer contains everything about the data: how to access it, how to validate it, which behaviors, it has, and the relationships between the data.
- T – “Template,” the presentation layer. This layer defines how something should be displayed on a Web page .
- V -“View,” the logic layer. This layer contains the logic that accesses the model and defers to the appropriate template.
The diagram illustrates how each of the components of the MVT pattern interacts with each other to serve a user request. 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.