dag/flask-genshi — Issue #14: xi:include doesn't seem to use the same loader as render_response
Author: wickedgrey
Created: 2011-12-07 20:07:19+00:00
State: open

I have a directory structure set up like this:

webapp/templates/boilerplate/header.xml
webapp/
myblueprint/
templates/
foo.xml
controller.py

Inside of foo.xml I'm trying to:

But I keep getting this error, no matter how I spell it:

File "build/bdist.macosx-10.6-intel/egg/genshi/template/loader.py",
line 246, in load
raise TemplateNotFound(filename, search_path)
TemplateNotFound: Template "/boilerplate/header.xml" not found

At the top of the controller in question, I have the following code:

for x in app.genshi_instance.template_loader.search_path:
try:
print x
print x('boilerplate/header.xml')
except Exception, e:
print e
pass

Which produces:

('/.../webapp/templates/boilerplate/header.xml',
'boilerplate/header.xml', , )

Template "boilerplate/header.xml" not found

Similarly, if I try to access 'otherblueprint/something.xml' from the controller, the _dispatch_by_prefix finds it, but generates a TemplateNotFound error inside of the template.

Any idea why?