For a new project we\'re writing documentation about the Django template system. We use Django for the documentation project itself too, so Django picks up all our exam
I solved this by adding an "include_raw" template tag that behaves like the built-in "include" tag, but just doesn't parse or process the file passed to it. I'm running Django 1.2 under App Engine.
Create a tags module (tags.py):
from django.template import loader
from google.appengine.ext.webapp import template
register = template.create_template_register()
@register.simple_tag
def include_raw(path):
return loader.find_template(path)[0]
Register it:
from google.appengine.ext.webapp import template
template.register_template_library("tags")
Use it:
{% include_raw "this-will-be-included-verbatim.html" %}