«Django follows the MTV (Model-Template-View) pattern. It is a slightly similar pattern to the well-known MVC (Model-View-Controller) pattern, where the template acts as the view and the framework itself acts as the controller.

The responsibilities in the Django MTV pattern are divided as follows:

  • Model: This defines the logical data structure and is the data handler between the database and the view.
  • Template: This is the presentation layer. Django uses a plain-text template system that keeps everything that the browser renders.
  • View: This communicates with the database via the model and transfers the data to the template for viewing.»

«The QuerySet equates to a SELECT SQL statement and the filters are limiting SQL clauses such as WHERE or LIMIT.»

Отрывок из книги Django 5 By Example_Fifth Edition Antonio Melé Этот материал может быть защищен авторским правом.


📂 Django | Последнее изменение: 23.05.2024 13:41