import sys, ashd.wsgiutil n = 0 def application(env, startreq): global n startreq("200 OK", [("Content-Type", "text/html")]) yield "\n" yield "
Do note how the single-process nature of ashd-wsgi
"
yield "allows data to be kept in memory persistently across requests, and "
yield "how the following counter increases by one for each request: " + str(n) + "
This script is a very raw WSGI example, using no glue code "
yield "whatever, but you should be able to use whatever WSGI middleware "
yield "you like in order to make it easier to code WSGI. If you have no "
yield "particular preference, I might recommend "
yield "WRW, "
yield "my WSGI Request Wrapper library, which is particularly made for "
yield "ashd-wsgi
and therefore, for instance, allows "
yield "non-pickleble objects (like sockets) to be stored in sessions.
If you have installed the Python3 utilities as well, there is " yield "also a Python3 script to demonstrate that " yield "Python3 is supported as well.\n" yield "
The current Python interpreter is " + ashd.wsgiutil.htmlquote(sys.version) + "
.