Django follows the MVT (Model-View-Template) architecture — its variation on the classic MVC pattern. It separates an application into three layers: Models (data), Views (logic), and Templates (presentation). Understanding the layers clarifies where each piece of code belongs.
The three layers
Model → the DATA layer: defines structure & talks to the database (the ORM)
View → the LOGIC layer: processes requests, fetches data, returns responses
Template → the PRESENTATION layer: HTML with placeholders for dynamic data
