diff options
author | hao huang <huang1hao@gmail.com> | 2015-03-28 08:10:39 +0000 |
---|---|---|
committer | hao huang <huang1hao@gmail.com> | 2015-03-28 08:10:39 +0000 |
commit | cf7e560f89016a302342821f5071941a09c04283 (patch) | |
tree | f8b50954525cf4c063ac09597f9ac576bf92b16e /paste/deploy/paster_templates/paste_deploy/+package+/sampleapp.py_tmpl | |
download | pastedeploy-git-huang1hao/fix-typo-in-docsindextxt-1427530235567.tar.gz |
Fix typo in docs/index.txthuang1hao/fix-typo-in-docsindextxt-1427530235567
Diffstat (limited to 'paste/deploy/paster_templates/paste_deploy/+package+/sampleapp.py_tmpl')
-rw-r--r-- | paste/deploy/paster_templates/paste_deploy/+package+/sampleapp.py_tmpl | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/paste/deploy/paster_templates/paste_deploy/+package+/sampleapp.py_tmpl b/paste/deploy/paster_templates/paste_deploy/+package+/sampleapp.py_tmpl new file mode 100644 index 0000000..cb49352 --- /dev/null +++ b/paste/deploy/paster_templates/paste_deploy/+package+/sampleapp.py_tmpl @@ -0,0 +1,23 @@ +import cgi + +from paste.deploy.config 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 = [ + '<html><head><title>%s</title></head>\n' % greeting, + '<body><h1>%s!</h1>\n' % greeting, + '<table border=1>\n', + ] + items = environ.items() + items.sort() + for key, value in items: + content.append('<tr><td>%s</td><td>%s</td></tr>\n' + % (key, cgi.escape(repr(value)))) + content.append('</table></body></html>') + return content |