Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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,
        'url_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!


1 Answers

the template.render accept 2 arguments , when there is no values to pass just use this {}

so it will be template.render(templatefile , {})

like image 51
Saif al Harthi Avatar answered Dec 19 '25 06:12

Saif al Harthi



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!