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:
“I think that a young state, like a young virgin, should modestly stay at home, and wait the application of suitors for an alliance with her; and not run about offering her amity to all the world; and hazarding their refusal.... Our virgin is a jolly one; and tho at present not very rich, will in time be a great fortune, and where she has a favorable predisposition, it seems to me well worth cultivating.”
—Benjamin Franklin (17061790)
“The receipt to make a speaker, and an applauded one too, is short and easy.Take of common sense quantum sufficit, add a little application to the rules and orders of the House, throw obvious thoughts in a new light, and make up the whole with a large quantity of purity, correctness, and elegancy of style.”
—Philip Dormer Stanhope, 4th Earl Chesterfield (16941773)