Skip to content

Instantly share code, notes, and snippets.

@cdent
Created November 24, 2009 19:54
Show Gist options
  • Select an option

  • Save cdent/242144 to your computer and use it in GitHub Desktop.

Select an option

Save cdent/242144 to your computer and use it in GitHub Desktop.
"""
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