In what order does django execute the various components when it receives a request? Specifically when does the middleware get invoked compared to the function that a route resolves to? And when do context processors get called?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The middlewares are executed before the view and when returning the response.
The context processor is executed when rendering a template, usually at the end of the view.
So:
(request) -> middleware, from top to bottom -> view -> context_processor -> (response) -> middleware, from bottom to top