nl: call the method middleware.process_template_response with 2 arguments: request and response, substitute the result for response.
code: response = middleware . process_template_response ( request , response )