Model–view–controller (MVC) separates a dynamic application into three cooperating parts: the model holds data and business logic, the view presents data, and the controller handles user interaction. This separation helps applications combine stored information, program logic, and web-page presentation without treating the site as a pile of static files. section 1.1.1 section 1.3
In Django, the responsibilities map to familiar Python and framework components:
- Models represent application data and business logic independently of the user interface. section 1.1.1
- Views present data; a Django view is a function or class that receives a request and returns a response document. section 1.1.1 section 1.3
- Controllers provide the input and control mechanism, although Django leaves the boundary between views and controllers deliberately fuzzy. section 1.1.1
A Django request path
A web server passes a URL request through WSGI to Django. Django checks urls.py, follows urlpatterns to a matching path, and calls the mapped view. The view can compose HTML with a template engine and return the resulting document to the browser. section 1.1.1 section 1.3
Figure 1.4 Model—view—controller architectural pattern
Use the architectural diagram to visualize how models, views, and controllers divide application responsibilities. section 1.1.1



