I know you can render a template by using something like:
template_values = {
'contacts': contacts,
'url': url,
'ur开发者_StackOverflow社区l_linktext': url_linktext,
}
path = os.path.join(os.path.dirname(__file__), 'index.html')
self.response.out.write(template.render(path, template_values))
My question is, how would I render a template ('addcontact.html) if it's just a simple form used to capture data?
Thanks!
the template.render accept 2 arguments , when there is no values to pass just use this {}
so it will be template.render(templatefile , {})
精彩评论