Created
November 24, 2009 19:54
-
-
Save cdent/242144 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Say Hi with a template. | |
| """ | |
| from tiddlywebplugins.templates import get_template | |
| def hello(environ, start_response): | |
| username = environ['tiddlyweb.usersign']['name'] | |
| template = get_template(environ, 'hello.html') | |
| start_response('200 OK', [('Content-Type', 'text/html; charset=UTF-8')]) | |
| return template.generate(username=username) | |
| def init(config): | |
| config['selector'].add('/hello', GET=hello) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment