I'm using App Engine's web-app templating system (similar if not identical to django)
Normally I render templates from my static directory /templates/ as follows in my main handler:
dirname = os.path.dirname(__file__)
template_file = os.path.join(dirname, os.path.join('templates', template_name))
output = template.render(template_file,template_values)
self.response.out.write(output)
For my current app, I want to render a template contained in a string. I'm using the following code:
t = template.Template(template_string)
c = template.Context(template_values)
output = t.render(c)
self.response.out.write(output)
It renders the template, but not the "include" tags contained within the string. For example, the string template
"hello world {% include 'helloworld.html' %}"
renders "hello world" but does not render the contents of 'helloworld.html'. I'm guessing that this has something to do with the string not being in the same directory as 'helloworld.html', but I'm not sure how to specify that the include tags should look in '/templates/*' Any help would be appreciated, Arjun