InterviewSolution
| 1. |
What is MVT and MVC, How it’s related to Django? |
|
Answer» MVT that is Model, View, Template, and MVC that is Model View, Controller, are design patterns. Programmers may use, extend or not use these READY to use design patterns. MVC design PATTERN was built specifically to separate out BUSINESS logic and data. MVC allows representing the same data in multiple ways. In MVC pattern Model is the “data” part, View is the “presentation” part and the Controller is the “coordination” part. MVT is Model View Template. Here View acts as “Controller” and has no one to one mapping in CASE of Django. The MAJOR difference between the two patterns is that Django takes care of the Controller part. The Django template is an HTML file mixed with Django Template Language. The developer develops the Model, the view and the template then maps it to a URL and then Django does the magic to serve it to the user. |
|