Django Book 翻译
菜单>:
TOC
返回
原文:
Many of these contributed frameworks (CSRF, the auth system, etc.) do their magic by providing a piece of *middleware* . Middleware is essentially code that runs before and/or after every single request and can modify each request and response at will. Next, well discuss Djangos built-in middleware and explain how you can write your own.
翻译:
这些继承框架(CSRF、身份验证系统等等)通过提供 *中间件* 来实现其奇妙的功能。本质上,中间件就是在每个请求之前或/和之后运行的代码,它们可随意修改每个请求或响应。接下来,我们将讨论 Django 的内建中间件,并解释如何编写自己的中间件。
备注:
译者: