AppEngine and Django: including a template file
Posted
by PythonPower
on Stack Overflow
See other posts from Stack Overflow
or by PythonPower
Published on 2009-01-22T17:12:54Z
Indexed on
2010/05/25
17:01 UTC
Read the original article
Hit count: 189
As the title suggests, I'm using Google App Engine and Django.
I have quite a bit of identical code across my templates and would like to reduce this by including template files. So, in my main application directory I have the python handler file, the main template, and the template I want to include in my main template.
I would have thought that including {% include "fileToInclude.html" %} would work on its own but that simply doesn't include anything. I assume I have to set something up, maybe using TEMPLATE_DIRS, but can't figure it out on my own.
EDIT:
I've tried:
TEMPLATE_DIRS = (os.path.join(os.path.dirname(__file__), 'templates'), )
But to no avail. I'll try some other possibilities too.
© Stack Overflow or respective owner