Example Application
A WSGI-compatible “Hello World” application written in Python:
def application(environ, start_response): start_response('200 OK', ) yield 'Hello World\n'Where:
- Line 1 defines a callable named
application, which takes two parameters,environandstart_response.environis a dictionary containing environment variables in CGI.start_responseis a callable taking two required parametersstatusandresponse_headers. - Line 2 calls
start_response, specifying "200 OK" as the status and a "Content-Type" header. - Line 3 returns the body of response as a string literal.
Read more about this topic: Web Server Gateway Interface
Famous quotes containing the word application:
“The main object of a revolution is the liberation of man ... not the interpretation and application of some transcendental ideology.”
—Jean Genet (19101986)
“If you would be a favourite of your king, address yourself to his weaknesses. An application to his reason will seldom prove very successful.”
—Philip Dormer Stanhope, 4th Earl Chesterfield (16941773)