开发者

How to render a Google App Engine template?

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 , {})

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜