import cgi from paste.deploy import CONFIG def application(environ, start_response): # Note that usually you wouldn't be writing a pure WSGI # application, you might be using some framework or # environment. But as an example... start_response('200 OK', [('Content-type', 'text/html')]) greeting = CONFIG['greeting'] content = [ '%s\n' % greeting, '

%s!

\n' % greeting, '\n', ] items = environ.items() items.sort() for key, value in items: content.append('\n' % (key, cgi.escape(repr(value)))) content.append('
%s%s
') return content