Hi!
Django's template system encourages extension of base templates as a
mechanism of template reuse. However simple functionality for inclusion
templates is still needed. Here's the example.
I have a web application for manipulating images. It has a central
interface part (one Django view) from which many functions are called:
add images window, framing tools window etc. All these windows are
supposed to work both as separate views and as dialogs loaded into main
interface with XmlHTTPrequest. In these two modes the essential part of
the window is the same. But when working as a standalone page it has all
header-footer stuff from a base template and when working as a dialog it
doesn't.
This is where I need 'include' tag: I have specific template which
should work in different environments. With template extension I can't
extract essential part from the full page.
There is an 'ssi' tag which could help but it's not convenient: it
requires absolute path which breaks portability of the application. And
also it requires adding absolute path to the settings file (it's not
documented btw).
I implemented 'include' for my own app tag library and it works very simple:
{% include myapp/template %}
I'll be happy to make a patch to add it to Django core. What do you think?