WSGI is a what? Vernacular wsgi tell you what to do!

definition:

官方定义:wsgi是Web服务器网关接口(Python Web Server Gateway Interface,缩写为WSGI)是为Python语言定义的Web服务器和Web应用程序或框架之间的一种简单而通用的接口。
大白话:wsgi就是一种规范,它定义了使用web应用程序与Python编写的web服务器程序之间的接口格式,实现web应用程序与web服务器程序间的解耦。

the nature of web applications:

  1. The browser sends a HTTP request;
  2. Server receives the request, generates an HTML document;
  3. Body HTML document as the server's HTTP response to the browser;
  4. Browser receives the HTTP response, remove the document from HTML and HTTP Body display.

WSGI interfaces Workflow

to sum up

wsgi就是一种规范,它定义了使用web应用程序与Python编写的web服务器程序之间的接口格式.无论多么复杂的Web应用程序,入口都是一个WSGI处理函数。HTTP请求的所有输入信息都可以通过environ获得,HTTP响应的输出都可以通过start_response()加上函数返回值作为Body。
Flask中的werkzeug工作原理类似.

- Understand, exhibitions

Guess you like

Origin www.cnblogs.com/bigox/p/11588017.html