Hey there..

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

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to