WSGI stands for Web Server Gateway Interface ... - Deepstash

WSGI stands for Web Server Gateway Interface and represents a simple calling convention for web servers to forward requests to web applications or frameworks written in the Python programming language. The current version of WSGI, version 1.0.1, is specified in Python Enhancement Proposal (PEP) 3333.

STASHED IN:

2

STASHED IN:

0 Comments

MORE IDEAS FROM What is WSGI?

A WSGI middleware component is a Python callable that is itself a WSGI application, but may handle requests by delegating to other WSGI applications. These applications can themselves be WSGI middleware components.

A middleware component can perform such functions as:

  • 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.

STASHED IN:

2

The WSGI has two sides:

  • the server/gateway side. This is often running full web server software such as Apache or Nginx.
  • the application/framework side. This is a Python callable, supplied by the Python program or framework.

Between the server and the application, there may be one or more WSGI middleware components, which implement both sides of the API, typically in Python code.

WSGI does not specify how the Python interpreter should be started, nor how the application object should be loaded or configured, and different frameworks and webservers achieve this in different ways.

STASHED IN:

2

Why use WSGI and not just point a web server directly at an application?

  • WSGI gives you flexibility. Application developers can swap out web stack components for others. For example, a developer can switch from Green Unicorn to uWSGI without modifying the application or framework that implements WSGI.
  • WSGI servers promote scaling. Serving thousands of requests for dynamic content at once is the domain of WSGI servers. WSGI servers handle processing requests from the web server and deciding how to communicate those requests to an application framework's process.

STASHED IN:

2

Why is WSGI necessary?

A traditional web server does not understand or have any way to run Python applications. 

Therefore the Python community came up with WSGI as a standard interface that modules and containers could implement. WSGI is now the accepted approach for running Python web applications.

As shown in the above diagram, a WSGI server simply invokes a callable object on the WSGI application as defined by the PEP 3333 standard.

Some examples of WSGI servers are: Green Unicorn, uWSGI, mod_wsgi and CherryPy.

STASHED IN:

2

Deepstash helps you become inspired, wiser and productive, through bite-sized ideas from the best articles, books and videos out there.

GET THE APP:

RELATED IDEA

Representational state transfer (REST) is a software architectural style that was created to guide the design and development of the architecture for the World Wide Web. REST defines a set of constraints for how the architecture of an Internet-scale distributed hypermedia system, such as the Web, should behave.

STASHED IN:

2

STASHED IN:

0 Comments

  • Python is a general-purpose, object-oriented programming language.
  • It emphasises code readability by using white space.
  • It is easy to learn.
  • It is a favourite of programmers and developers.
  • Python is very well suited for use in machine learning at a large scale.
  • Its suite of specialised deep learning and machine learning libraries includes tools like scikit-learn, Keras and TensorFlow. It enables data scientists to develop sophisticated data models that plug directly into a production system.

6

STASHED IN:

11

STASHED IN:

0 Comments