Share
VIDEOS 1 TO 50
Understanding WSGI Within Django
Understanding WSGI Within Django
Published: 2016/11/12
Channel: Master Code Online
Server Side Script Setup - CGI Webserver with Python - Linux Tutorials
Server Side Script Setup - CGI Webserver with Python - Linux Tutorials
Published: 2014/12/18
Channel: Kris Occhipinti
CGI: What is CGI? | lynda.com
CGI: What is CGI? | lynda.com
Published: 2012/10/02
Channel: LinkedIn Learning Solutions
JavaScript and its Web server gateway interfaces
JavaScript and its Web server gateway interfaces
Published: 2015/11/19
Channel: ViennaJS
Creating WSGI Middleware - Alan Christopher Thomas - Minted - PythonKC
Creating WSGI Middleware - Alan Christopher Thomas - Minted - PythonKC
Published: 2015/08/28
Channel: Alan Thomas
Use C++ as a Server Side Language (CGI Common Gateway Interface)
Use C++ as a Server Side Language (CGI Common Gateway Interface)
Published: 2016/12/22
Channel: RobotZer0
Common Gateway Interface
Common Gateway Interface
Published: 2014/08/17
Channel: Audiopedia
Python : Hello World in web
Python : Hello World in web
Published: 2014/01/18
Channel: padam raj gurung
Deploying Flask Applications to the Cloud - Creating Our wsgi File (10/11)
Deploying Flask Applications to the Cloud - Creating Our wsgi File (10/11)
Published: 2016/01/23
Channel: From Zero
What is an API?
What is an API?
Published: 2015/06/19
Channel: MuleSoft Videos
Modern Python Solutions - Part 3 : Implementing Web Services with WSGI | packtpub.com
Modern Python Solutions - Part 3 : Implementing Web Services with WSGI | packtpub.com
Published: 2017/04/12
Channel: Packt Video
How to execute WSGI file with Dynamic content in Apache
How to execute WSGI file with Dynamic content in Apache
Published: 2017/03/03
Channel: Linux Help
17 introducing wsgi
17 introducing wsgi
Published: 2017/03/05
Channel: The New Cairo
Apache Tutorial   Apache with mod wsgi on Linux
Apache Tutorial Apache with mod wsgi on Linux
Published: 2016/07/15
Channel: Basic Linux Installation Configuration
apache2 mod_Wsgi pip install
apache2 mod_Wsgi pip install
Published: 2015/03/24
Channel: Python tutorial
Evolution of werkzeug (Gource Visualization)
Evolution of werkzeug (Gource Visualization)
Published: 2015/07/21
Channel: Landon Wilkins
mod_wsgi-express on Ubuntu server with python bottle tutorial
mod_wsgi-express on Ubuntu server with python bottle tutorial
Published: 2015/10/09
Channel: flouken
Install Django on Apache with mod_wsgi on Linux
Install Django on Apache with mod_wsgi on Linux
Published: 2012/10/03
Channel: flouken
RHCE EX300-7 Apache Web Services Part-7 of 8
RHCE EX300-7 Apache Web Services Part-7 of 8
Published: 2016/10/23
Channel: Sonet Institute of Technology
apache server wsgi server
apache server wsgi server
Published: 2016/01/16
Channel: Moise Lubwimi
Learning Django Web Development: Introducing WSGI | packtpub.com
Learning Django Web Development: Introducing WSGI | packtpub.com
Published: 2015/07/01
Channel: Packt Video
WSGI Visit
WSGI Visit
Published: 2014/12/02
Channel: TennRadioHOF
Using benchmarks to understand how WSGI servers work. by Graham Dumpleton
Using benchmarks to understand how WSGI servers work. by Graham Dumpleton
Published: 2015/08/03
Channel: PyCon Australia
Secrets of a WSGI master.
Secrets of a WSGI master.
Published: 2017/08/07
Channel: PyCon Australia
Asynchronous WSGI - proof of concept
Asynchronous WSGI - proof of concept
Published: 2007/12/16
Channel: majek04
Choose Your Own WSGI Deployment Adventure - PyCon 2015
Choose Your Own WSGI Deployment Adventure - PyCon 2015
Published: 2015/10/07
Channel: TechKeka
Asynchronous WSGI - proof of concept
Asynchronous WSGI - proof of concept
Published: 2007/12/16
Channel: majek04
How to deploy a Django project on Windows system
How to deploy a Django project on Windows system
Published: 2017/03/30
Channel: Khiêm Đoàn
Matt - Full Stack Python
Matt - Full Stack Python
Published: 2014/09/22
Channel: EuroPython Conference
How To Deploy a Python Flask Application with Apache and mod_wsgi
How To Deploy a Python Flask Application with Apache and mod_wsgi
Published: 2014/03/04
Channel: Saju M
201_108_Secrets of a WSGI master._Graham Dumpleton
201_108_Secrets of a WSGI master._Graham Dumpleton
Published: 2017/09/08
Channel: PyConJP
A resume-based WSGI Load Balancer
A resume-based WSGI Load Balancer
Published: 2012/03/12
Channel: Next Day Video
5 WSGI configure and flask - Amazon Web Service Tutorial - Python Flask
5 WSGI configure and flask - Amazon Web Service Tutorial - Python Flask
Published: 2017/03/02
Channel: Jae duk Seo
Lecture -19 CGI Scripts
Lecture -19 CGI Scripts
Published: 2008/08/07
Channel: nptelhrd
Deployment and Configuration of Python odoo apache wsgi
Deployment and Configuration of Python odoo apache wsgi
Published: 2017/07/18
Channel: WEB DEVELOPER
Montreal Python 10 Alexandre Bourget WSGI
Montreal Python 10 Alexandre Bourget WSGI
Published: 2011/10/07
Channel: MontrealPython
Fabric-less deployments for WSGI apps (Dorian Pula)
Fabric-less deployments for WSGI apps (Dorian Pula)
Published: 2015/11/25
Channel: PyCon Canada
WSGISecurity  Pre-Alpha Demo
WSGISecurity Pre-Alpha Demo
Published: 2009/05/17
Channel: steveashcrowmilner
WSGI
WSGI
Published: 2011/04/28
Channel: pennystockrain
WSGI Adwords Keyword Tool - Tabbed interface plus location and language targets
WSGI Adwords Keyword Tool - Tabbed interface plus location and language targets
Published: 2010/11/26
Channel: greatsoftw
Texas A&M WSGI
Texas A&M WSGI
Published: 2012/08/24
Channel: Greg Phelps
Scegliere con saggezza il proprio WSGI server
Scegliere con saggezza il proprio WSGI server
Published: 2012/07/06
Channel: EuroPython Conference
Apache, Werkzeug and mod_wsgi being silly
Apache, Werkzeug and mod_wsgi being silly
Published: 2011/10/08
Channel: sentesays
D9T Rollout of a simple wsgi app in 60 seconds (based on pyramid)
D9T Rollout of a simple wsgi app in 60 seconds (based on pyramid)
Published: 2012/02/09
Channel: wamdamdam1
Common Gateway Interface (CGI)
Common Gateway Interface (CGI)
Published: 2015/01/28
Channel: Others Channel
WSGI PowerShift April 2017 1-1553
WSGI PowerShift April 2017 1-1553
Published: 2017/04/13
Channel: Intrigue Media: Video Advertising
Install Django on Windows with WAMP
Install Django on Windows with WAMP
Published: 2012/10/21
Channel: JREAM
"Oh, Give Me A Day" Live on Americana Country WSGI
"Oh, Give Me A Day" Live on Americana Country WSGI
Published: 2017/04/25
Channel: Nina Ricci
wsgi company outing
wsgi company outing
Published: 2011/04/10
Channel: kevilaine2011
WSGI PowerShift April 2017 1-1553
WSGI PowerShift April 2017 1-1553
Published: 2017/04/05
Channel: Intrigue Media: Video Advertising
NEXT
GO TO RESULTS [51 .. 100]

WIKIPEDIA ARTICLE

From Wikipedia, the free encyclopedia
Jump to: navigation, search

The Web Server Gateway Interface (WSGI) is a specification for simple and universal interface between web servers and web applications or frameworks for the Python programming language. It was originally specified in PEP 333[1] authored by Phillip J. Eby, and published on 7 December 2003. It has since been adopted as a standard for Python web application development. The latest version of the specification is v1.0.1, also known as PEP 3333, published on 26 September 2010.[2]

Background[edit]

Python web frameworks had been a problem for new Python users since the choice of web framework would limit the choice of usable web servers, and vice versa. Python applications were often designed for only one of CGI, FastCGI, mod_python, or some other custom API of a specific web server.[3]

WSGI was created as a low-level interface between web servers and web applications or frameworks to promote common ground for portable web application development.[2]

Specification overview[edit]

The WSGI has two sides: the "server" or "gateway" side (often a web server such as Apache or Nginx), and the "application" or "framework" side (the Python script itself). To process a WSGI request, the server side executes the application and provides environment information and a callback function to the application side. The application processes the request, returning the response to the server side using the callback function it was provided.[citation needed]

Between the server and the application, there may be a WSGI middleware, which implements both sides of the API. The server receives a request from a client and forwards it to the middleware. After processing, it sends a request to the application. The application's response is forwarded by the middleware to the server and ultimately to the client. There may be multiple middlewares forming a stack of WSGI-compliant applications.[citation needed]

A "middleware" component can perform such functions as:[citation needed]

  • Routing a request to different application objects based on the target URL, after changing the environment variables accordingly.
  • Allowing multiple applications or frameworks to run side-by-side in the same process
  • Load balancing and remote processing, by forwarding requests and responses over a network
  • Performing content post-processing, such as applying XSLT stylesheets

Examples[edit]

Example application[edit]

A WSGI-compatible "Hello, World" application written in Python:

1 def application(environ, start_response):
2     start_response('200 OK', [('Content-Type', 'text/plain')])
3     yield 'Hello, World\n'

Where:

  • Line 1 defines a callable[4] named application, which takes two parameters, environ and start_response. environ is a dictionary containing environment variables in CGI. start_response is a callable taking two required parameters status and response_headers.
  • Line 2 calls start_response, specifying "200 OK" as the status and a "Content-Type" header.
  • Line 3 returns the body of the response as a string literal.

Example of calling an application[edit]

An example of calling an application and retrieving its response.[5] A web server gives a callback start_response to a web framework application. A start_response has an http protocol status, headers, and body. For Django, an HttpResponse object is returned.[6][7] The "environ" fragment consists of, for example, REQUEST_METHOD info.[8] Depending on this info, it might or might not call ("OPTIONS") this app.[citation needed]

def call_application(app, environ):
    body = []
    status_headers = [None, None]
    def start_response(status, headers):
        status_headers[:] = [status, headers]
        return body.append(status_headers)
    app_iter = app(environ, start_response)
    try:
        for item in app_iter:
            body.append(item)
    finally:
        if hasattr(app_iter, 'close'):
            app_iter.close()
    return status_headers[0], status_headers[1], ''.join(body)

status, headers, body = call_application(app, {...environ...})

WSGI-compatible applications and frameworks[edit]

Numerous web frameworks support WSGI:

Wrappers[edit]

The server or gateway invokes the application callable once for each request it receives from an HTTP client that is directed at the application.[citation needed]

Currently wrappers are available for FastCGI, CGI, SCGI, AJP (using flup), twisted.web, Apache (using mod_wsgi or mod_python), Nginx (using ngx_http_uwsgi_module),[23] and Microsoft IIS (using WFastCGI,[24] isapi-wsgi,[25] PyISAPIe,[26] or an ASP gateway).

WSGI and Python 3[edit]

The separation of binary and text data in Python 3 poses a problem for WSGI, as it specifies that header data should be strings, while it sometimes needs to be binary and sometimes text. This works in Python 2 where text and binary data both are kept in "string" variables, but in Python 3 binary data is kept in "bytes" variables and "string" variables are for unicode text data. An updated version of the WSGI specification that deals with this is PEP 3333.[27]

A reworked WSGI spec Web3 has also been proposed, specified in PEP444. This standard is an incompatible derivative of WSGI designed to work on Python 2.6, 2.7, 3.1+.[28]

See also[edit]

References[edit]

  1. ^ "PEP 333 - Python Web Server Gateway Interface v1.0". Python.org. Retrieved 2017-01-27. 
  2. ^ a b "PEP 3333 - Python Web Server Gateway Interface v1.0.1". Python.org. Retrieved 2017-01-27. 
  3. ^ "FrontPage - Python Wiki". Python.org. Retrieved 2017-01-27. 
  4. ^ i.e. "a function, method, class, or an instance with a __call__ method"
  5. ^ "Creating WSGI Middleware - Alan Christopher Thomas - Minted - PythonKC". YouTube. 2015-08-28. Retrieved 2017-01-27. 
  6. ^ "Request and response objects | Django documentation | Django". Docs.djangoproject.com. Retrieved 2017-01-27. 
  7. ^ django (1970-01-01). "django/response.py at master · django/django · GitHub". Github.com. Retrieved 2017-01-27. 
  8. ^ "PEP 333 - Python Web Server Gateway Interface v1.0". Python.org. Retrieved 2017-01-27. 
  9. ^ "プエラリアジェルの効果は?". Bobo.digicool.com. Retrieved 2017-01-27. 
  10. ^ "Django without mod_python, and WSGI support | Weblog | Django". Djangoproject.com. 2005-07-18. Retrieved 2017-01-27. 
  11. ^ "wsgi – WSGI server — Eventlet 0.20.1 documentation". Eventlet.net. Retrieved 2017-01-27. 
  12. ^ "gevent-fastcgi 1.0.2.1 : Python Package Index". Pypi.python.org. 2015-12-06. Retrieved 2017-01-27. 
  13. ^ "anomaly/prestans: A WSGI compliant REST micro-framework". GitHub.com. Retrieved 2017-01-27. 
  14. ^ "Google Code Archive - Long-term storage for Google Code Project Hosting". Code.google.com. Retrieved 2017-01-27. 
  15. ^ "Pycnic Framework". Pycnic.nullism.com. Retrieved 2017-01-27. 
  16. ^ "theintencity/restlite: Light-weight RESTful server tools in Python". GitHub.com. Retrieved 2017-01-27. 
  17. ^ "limodou/uliweb: Simple and easy use python web framework". GitHub.com. Retrieved 2017-01-27. 
  18. ^ "Welcome to". Web.py. 2009-09-11. Retrieved 2017-01-27. 
  19. ^ [1]
  20. ^ "weblayer — weblayer v0.4.3 documentation". Packages.python.org. Retrieved 2017-01-27. 
  21. ^ "Welcome | Werkzeug (The Python WSGI Utility Library)". Werkzeug.pocoo.org. Retrieved 2017-01-27. 
  22. ^ "CalDAV and CardDAV Server - A Simple Calendar and Contact Server". Radicale.org. Retrieved 2017-01-27. 
  23. ^ "Module ngx_http_uwsgi_module". Nginx.org. Retrieved 2017-01-27. 
  24. ^ "Python Tools for Visual Studio - Documentation". Pytools.codeplex.com. Retrieved 2017-01-27. 
  25. ^ "Google Code Archive - Long-term storage for Google Code Project Hosting". Code.google.com. Retrieved 2017-01-27. 
  26. ^ "Python ISAPI Extension for IIS download | SourceForge.net". Pyisapie.sourceforge.net. 2012-04-24. Retrieved 2017-01-27. 
  27. ^ Eby, P.J. (2010-09-26). "PEP 3333". Retrieved 2011-07-27. 
  28. ^ McDonough, Chris; Ronacher, Armin (2010-07-19). "PEP 444 – Python Web3 Interface". Retrieved 2010-09-20. 

External links[edit]

Disclaimer

None of the audio/visual content is hosted on this site. All media is embedded from other sites such as GoogleVideo, Wikipedia, YouTube etc. Therefore, this site has no control over the copyright issues of the streaming media.

All issues concerning copyright violations should be aimed at the sites hosting the material. This site does not host any of the streaming media and the owner has not uploaded any of the material to the video hosting servers. Anyone can find the same content on Google Video or YouTube by themselves.

The owner of this site cannot know which documentaries are in public domain, which has been uploaded to e.g. YouTube by the owner and which has been uploaded without permission. The copyright owner must contact the source if he wants his material off the Internet completely.

Powered by YouTube
Wikipedia content is licensed under the GFDL and (CC) license