Django中间件
2020-01-30 16:35:27 3 举报
Django Middleware
作者其他创作
大纲/内容
middlewareC::process_response
2. middleware注册:
middlewareB::process_view
middlewareB::process_request
middlewareA::process_response
middlewareB::process_response
middlewareC::process_exception
5 response phase
1 request phase
middlewareB::process_exception
middlewareA
middlewareC::process_view
middlewareB
middlewareC::process_request
3 exception phase
3.1 加载中间件:
1. middleware定义:
2 view phase
4 template_response phase
middlewareA::process_exception
middlewareC
3.2 执行中间件:
middlewareB::process_template_response
middlewareA::process_request
middlewareC::process_template_response
中间件是处理Django处理请求、响应的钩子框架。它一个全局处理django请求和响应的底层插件系统。每个中间件只完成特定功能,比如AuthticationMiddleware通过request处理用户认证。
middlewareA::process_view
0 条评论
回复 删除
下一页