Based on my current understanding of Django, this is how a user request is responded to.
- User requests a page
- Request reaches Request Middlewares, which could manipulate or answer the request
- The URLConffinds the related View using urls.py
- View Middlewares are called, which could manipulate or answer the request
- The view function is invoked
- The view could optionally access data through models
- All model-to-DB interactions are done via a manager
- Views could use a special context if needed
- The context is passed to the Template for rendering
- Template uses Filters and Tags to render the output
- Output is returned to the view
- HTTPResponse is sent to the Response Middlerwares
- Any of the response middlewares can enrich the response or return a completely new response
- The response is sent to the user’s browser.
Please leave a comment if I have got something wrong.