0% found this document useful (0 votes)
98 views8 pages

What Is MVT

The MVT pattern separates an application into three main components: the Model handles the data and database access; the View handles requests and responses and mediates between the Model and Template; and the Template represents how data is presented to the user and gets data from the View.

Uploaded by

Venu D
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
98 views8 pages

What Is MVT

The MVT pattern separates an application into three main components: the Model handles the data and database access; the View handles requests and responses and mediates between the Model and Template; and the Template represents how data is presented to the user and gets data from the View.

Uploaded by

Venu D
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Model View Template (MVT)

The MVT is an design pattern that separates an application into three main logical
components Model, View, and Template.
Each of these component has their own role in a Project.
Model
The Model responsible to handle database. It is a data access layer which handles the
data.
View
The user can send request by interacting with template, the view handles these requests
and sends to Model then get appropriate response from the Model, sends response to
template.
It may also have required logics.
It works as a mediator between Template and Model.
Template
It represents how data should be presented to the application user. User can read or
write the data from template.
Basically it is responsible for showing end user content, we can say it is user interface.
It may consists of HTML, CSS, JS mixed with Django Template Language.
• Server Side Logic
• Process GET/POST
• Get data from User
• Gets data from Model
• Pass data to Template

View • Insert/Update DB
• Communicate with
View

Routing Model

Template

• User Interface
• HTML/CSS Database
• Get Data from View
• Server Side Logic
• Process GET/POST
• Get data from User
• Gets data from Model
• Pass data to Template

Urls View • Process Data


• Insert/Update DB
• Communicate with
View

Model

Template

• User Interface
• HTML/CSS Database
• Get Data from View
Why use MVT
• Organized Code
• Independent Block
• Reduces the complexity of web applications
• Easy to Maintain
• Easy to modify
Basic Structure

You might also like