a simple and universal interface between web servers and web applications or frameworks: the Python Web Server Gateway Interface (WSGI).
WSGI is the Web Server Gateway Interface. It is a specification that describes how a web server communicates with web applications, and how web applications can be chained together to process one request.
WSGI is a Python standard described in detail in PEP 3333.
https://www.python.org/dev/peps/pep-3333/
Original Rationale and Goals (from PEP 333)
Python currently boasts a wide variety of web application frameworks, such as Zope, Quixote, Webware, SkunkWeb, PSO, and Twisted Web -- to name just a few [1]. This wide variety of choices can be a problem for new Python users, because generally speaking, their choice of web framework will limit their choice of usable web servers, and vice versa.
【类似 Java servelet api 服务器和web开发框架之间的接口规范 】
By contrast, although Java has just as many web application frameworks available, Java's "servlet" API makes it possible for applications written with any Java web application framework to run in any web server that supports the servlet API.
The availability and widespread use of such an API in web servers for Python -- whether those servers are written in Python (e.g. Medusa), embed Python (e.g. mod_python), or invoke Python via a gateway protocol (e.g. CGI, FastCGI, etc.) -- would separate choice of framework from choice of web server, freeing users to choose a pairing that suits them, while freeing framework and server developers to focus on their preferred area of specialization.
This PEP, therefore, proposes a simple and universal interface between web servers and web applications or frameworks: the Python Web Server Gateway Interface (WSGI).
But the mere existence of a WSGI spec does nothing to address the existing state of servers and frameworks for Python web applications. Server and framework authors and maintainers must actually implement WSGI for there to be any effect.
如全称代表的那样,WSGI不是服务器,不是API,不是Python模块,更不是什么框架,而是一种服务器和客户端交互的接口规范!
更具体的规范说明请搜索“PEP 3333”。
在WSGI规范下,web组件被分成三类:client, server, and middleware.
WSGI apps(服从该规范的应用)能够被连接起来(be stacked)处理一个request,这也就引发了中间件这个概念,中间件同时实现c端和s端的接口,c看它是上游s,s看它是下游的c。
WSGI的s端所做的工作仅仅是接收请求,传给application(做处理),然后将结果response给middleware或client.除此以外的工作都交给中间件或者application来做。
https://www.zhihu.com/question/19998865/answer/26203965
a simple and universal interface between web servers and web applications or frameworks: the Python Web Server Gateway Interface (WSGI).的更多相关文章
- Notes on PEP333 (Python Web Server Gateway Interface)
This note is about PEP3333- Python Web Server Gateway Interface. Refer to (Source: http://legacy.pyt ...
- 【Python Programe】WSGI (Web Server Gateway Interface)
Part1: What is a Web server? 一个位于物理服务器上的网络服务器(服务器里的服务器),等待客户端去发送request,当服务器接收到request,就会生成一个respons ...
- Python Web Server Gateway Interface -- WSGI
了解了HTTP协议和HTML文档,我们其实就明白了一个Web应用的本质就是: 浏览器发送一个HTTP请求: 服务器收到请求,生成一个HTML文档: 服务器把HTML文档作为HTTP响应的Body发送给 ...
- Python的WSGI(Web Server Gateway Interface)服务器
Python的WSGI(Web Server Gateway Interface)服务器 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任.
- python web server gateway interface (wsgi ) notes
前言: 注:如果需要得到支持批Python3.x以及包含了勘误表,附录,和说明的更新版规范,请查看PEP 3333 摘要: 这篇文档详细说明了一套在web服务器与Python web应用程序(web框 ...
- 全面解读python web 程序的9种部署方式
转载自鲁塔弗的博客,本文地址http://lutaf.com/141.htm python有很多web 开发框架,代码写完了,部署上线是个大事,通常来说,web应用一般是三层结构 web serve ...
- python web 程序的9种部署方式
python有很多web 开发框架,代码写完了,部署上线是个大事,通常来说,web应用一般是三层结构 Web Server====> Application=====> DB S ...
- Python Web开发中,WSGI协议的作用和实现原理详解
首先理解下面三个概念: WSGI:全称是Web Server Gateway Interface,WSGI不是服务器,python模块,框架,API或者任何软件,只是一种规范,描述web server ...
- Python Web开发中的WSGI协议简介
在Python Web开发中,我们一般使用Flask.Django等web框架来开发应用程序,生产环境中将应用部署到Apache.Nginx等web服务器时,还需要uWSGI或者Gunicorn.一个 ...
随机推荐
- LeetCode(59)Length of Last Word
题目 Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return th ...
- 洛谷 1196 [NOI2002]银河英雄传说【模板】带权并查集
[题解] 经典的带权并查集题目. 设cnt[i]表示i前面的点的数量,siz[i]表示第i个点(这个点是代表元)所处的联通块的大小:合并的时候更新siz.旧的代表元的cnt,路径压缩的时候维护cnt即 ...
- 创意、实现和合作:一次原创H5的尝试
3月的某一天需求同学说:我们想做一个爆款的回流H5. 好的事实上并没有这么夸张. 不过我们确实是第一次真正意义上做这样一个以互动展示为主要形式.以传播和拉回流为主要目的的H5. 虽然最后也没有成为真正 ...
- oracle备份表和数据
oracle 备份数据 如果备份表存在 原表t_base_employee,备份表t_base_employee20180718 insert into t_base_employee0718 sel ...
- UVALive 4015 树形dp
题目大意: 从一个根节点出发,走最多 x 的长度,问最多能走过多少个节点,图保证是一棵树 dp[0][i][j] , 表示走从i点为根的子树走过了j个点最后回到 i 最少需要多少时间dp[1][i][ ...
- bzoj 1500 [NOI 2005] 维修数列
题目大意不多说了 貌似每个苦逼的acmer都要做一下这个splay树的模版题目吧 还是有很多操作的,估计够以后当模版了.... #include <cstdio> #include < ...
- BZOJ1710: [Usaco2007 Open]Cheappal 廉价回文
len<=2000的字符串上,给出删掉和添加每种字符的花费,求把字符串变成回文串的最小花费. 首先每个字符添加和删除是一样的,因此花费在添加和删掉每个字符的花费中取小的. 如果每个字符的花费都是 ...
- Git学习之常见错误 clone被拒绝
Git学习之常见错误 问题: git clone 时 报错 Permission Denied (权限被拒绝). 解决方法: 需要把本地的公钥上传到服务器. 解决步骤: ①第一步,设置本地的git的用 ...
- 16 个常用的yum 命令
1. yum [-y] install package_name2. yum remove package_name 卸载指定软件3. ...
- javax/servlet/ServletContext : Unsupported major.minor version 51.0
原文:http://blog.csdn.net/mlin_123/article/details/50738532 解决:将版本从 3.1.0 改为 3.0.1 <!-- 添加servlet A ...