开发者

How to render a Google App Engine template?

开发者 https://www.devze.com 2023-02-04 18:13 出处:网络
I know you can render a template by using something like: template_values = { \'contacts\': contacts, \'url\': url,

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

精彩评论

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