Python自动化之Django中间件
django中间件
Django请求生命周期
中间件中可以定义方法,分别是
- process_request(self,request)
- process_view(self, request, callback, callback_args, callback_kwargs)
- process_template_response(self,request,response) [不太常用]
- process_exception(self, request, exception) [不太常用]
- process_response(self, request, response)
感谢关注