Django uses the MVT (Model-View-Template) architecture (or, sometimes called, MTV architecture). The MVT architecture is similar to the well-known MVC (Model-View-Control) architecture at a high level; however, they are different concepts in detail.
Using the MVT framework, Django separates an application design into three components. This separation makes it easier to develop and maintain the code in a more organized and structured way.
Let us explain the architecture with the HTTP request and response flow with key coding files to give you a more concrete idea. As the details will be explained in the following chapters, you can focus on more high-level concepts in this section.
In the actual implementation, you also need some other components of Django design architecture.
URL dispatcher: Handles URL requests to pass the request to View. It is written in the urls.py file.
Form: Handles user data input validations. This is optional as Django's built-in View inherits basic form functionalities.
Here are the basic steps when Django handles an HTTP request and returns an HTTP response:
In the next chapter, we'll explain each component (except for forms.py) in detail using this diagram.
MVC architecture is a software architectural design pattern that is widely used in GUI-based applications, including web applications.
The official Django documentation states that it could use the term Templates for Views in MVC and the term Views for Controller in MVC, and Django itself takes care of the Controller part.
Django uses the MVT (Model-View-Template) architecture (or, sometimes called, MTV architecture). The MVT architecture is similar to the well-known MVC (Model-View-Control) architecture at a high level; however, they are different concepts in detail.
Using the MVT framework, Django separates an application design into three components. This separation makes it easier to develop and maintain the code in a more organized and structured way.
Let us explain the architecture with the HTTP request and response flow with key coding files to give you a more concrete idea. As the details will be explained in the following chapters, you can focus on more high-level concepts in this section.
In the actual implementation, you also need some other components of Django design architecture.
URL dispatcher: Handles URL requests to pass the request to View. It is written in the urls.py file.
Form: Handles user data input validations. This is optional as Django's built-in View inherits basic form functionalities.
Here are the basic steps when Django handles an HTTP request and returns an HTTP response:
In the next chapter, we'll explain each component (except for forms.py) in detail using this diagram.
MVC architecture is a software architectural design pattern that is widely used in GUI-based applications, including web applications.
The official Django documentation states that it could use the term Templates for Views in MVC and the term Views for Controller in MVC, and Django itself takes care of the Controller part.