Web Server Gateway Interface: Difference between revisions

Content deleted Content added
Linking
Line 2:
 
==Idea==
Python boasts a wide variety of web application frameworks. This can be a problem for new Python users because, generally speaking, their choice of web framework will limit their choice of usable [[web serversserver]]s, and vice versa.
 
WSGI proposes a simple and universal [[interface (computer science)|interface]] between web servers and web applications or frameworks.
 
==Specification overview==
The WSGI interface has two sides: the "[[server]]" or "gateway" side, and the "application" or "framework" side. The server side invokes a callable object (usually a [[function (programming)|function]] or a [[method (computer science)|method]]) that is provided by the application side. Additionally WSGI provides middlewares[[middleware]]s, components that play both sides.
 
A "middleware" component can perform such functions as:
* Routing a request to different application objects based on the target [[Uniform Resource Locator|URL]], after rewritingchanging the environ[[environment variables]] accordingly.
* Allowing multiple applications or frameworks to run side-by-side in the same [[process (computing)|process]]
* [[Load balancing]] and remote processing, by forwarding requests and responses over a [[computer network|network]]
* Perform content postprocessing, such as applying [[XSL stylesheetsstylesheet]]s
 
==Example application==
Line 28:
* [[TurboGears]]
* [[Pylons (web framework)|Pylons]]
* [[web.py]] [http://webpy.org/ web.py]
 
Additionally there are two simple publishers:
Line 35:
 
==Wrappers==
The server or gateway invokes the application callable once for each request it receives from an [[HTTP]] client, that is directed at the application.
 
Currently wrappers are available for [[FastCGI]], [[Common Gateway Interface|CGI]], [[SCGI]], [[Apache JServ Protocol|AJP]] using the flup package.