Django WSGI Server
复习
- WSGI 协议主要包括 server 和 application 两部分:
- WSGI server 负责从客户端接收请求,将 request 转发给 application,将 application 返回的 response 返回给客户端
- WSGI application 接收由 server 转发的 request,处理请求,并将处理结果返回给 server。application中可以包括多个栈式的中间件(middlewares),这些中间件需要同时实现 server 与 application,因此可以在 WSGI 服务器与 WSGI 应用之间起调节作用:对服务器来说,中间件扮演应用程序,对应用程序来说,中间件扮演服务器。