MVC (Model-View-Controller) is a software design pattern for developing web applications. It consists of the following parts:
Model: It is responsible for managing data of the application. It can be a database, a single object, or some structure of objects etc. It can also have logic to update controller if its data changes.
View: View represents the visualization of the data that a model contains. It is responsible for which data should be displayed for a particular request.
Controller: It connects the View with the Model. It controls the data flow and keeps Model and View separate. It is responsible for responding to the user input and perform interactions on the data model objects.
Django - MVT (Model-View-Template) pattern is slightly different from MVC pattern. The main difference is Django itself take care of the Controller part. In the Template, it's just HTML file mixed with DTL - Django Template Language.
Comments
Post a Comment