I using google app engine, in 0.96 I have no problem to include a template as following
{% include "../header.html" %}
However, in 1.2 the code above not functioning??
Any idea?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The reason is that
google.appengine.ext.webapp.template.renderdoesn’t use any user-configurableTEMPLATE_DIRS. Instead it invents its ownTEMPLATE_DIRSbyt taking the directory of the given template and using that atTEMPLATE_DIRS. This means if you callrender("foo/bar/fie")it will usefoo/baras your template directory and look up files from there.Now, the change from 0.96 til 1.2 is that the file lookup switched from using
os.path.jointo usingdjango.utils._os.safe_joinwhich does not allow escape from the base directory using../.I don’t see any obvious way around this. It seems like you must call
renderwith a file directly in your template directory and not in a subdirectory.