Categories
Education Technology

Django Flowchart

Based on my current understanding of Django, this is how a user request is responded to.

Django Flowchart

  1. User requests a page

  2. Request reaches Request Middlewares, which could manipulate or answer the request

  3. The _URLConf_finds the related View using urls.py

  4. View Middlewares are called, which could manipulate or answer the request

  5. The view function is invoked

  6. The view could optionally access data through models

  7. All model-to-DB interactions are done via a manager

  8. Views could use a special context if needed

  9. The context is passed to the Template for rendering

  10. Template uses Filters and Tags to render the output

  11. Output is returned to the view

  12. HTTPResponse is sent to the Response Middlerwares

  13. Any of the response middlewares can enrich the response or return a completely new response

  14. The response is sent to the user’s browser.

Please leave a comment if I have got something wrong.