This post originated from an RSS feed registered with Python Buzz
by Shabda Raaj.
Original Post: Writing your own template loaders
Feed Title: The Uswaretech Blog - Django/Python Web Development
Feed URL: http://feeds.feedburner.com/UswareBlog
Feed Description: Blog about building web applications using Django/Python/Jquery.
Django has three builtin template loaders which are used to get the templates for rendering.
TEMPLATE_LOADERS = (
'django.template.loaders.filesystem.load_template_source',
'django.template.loaders.app_directories.load_template_source',
# 'django.template.loaders.eggs.load_template_source',
)
Writing your template loader is a awfuly easy. It is a callable which
Returns a tuple of (openfile, filename) if it can find the template.
Raise TemplateDoesNotExist if [...]
Related posts: