template.response.SimpleTemplateResponse.rendered_content

SimpleTemplateResponse.rendered_content The current rendered value of the response content, using the current template and context data.

template.loaders.eggs.Loader

class eggs.Loader Deprecated since version 1.9: Distributing applications as eggs is not recommended. Just like app_directories above, but it loads templates from Python eggs rather than from the filesystem. This loader is disabled by default. django.template.loaders.cached.Loader

template.loaders.locmem.Loader

class locmem.Loader Loads templates from a Python dictionary. This is useful for testing. This loader takes a dictionary of templates as its first argument: TEMPLATES = [{ 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'OPTIONS': { 'loaders': [ ('django.template.loaders.locmem.Loader', { 'index.html': 'content here', }), ], }, }] This loader is disabled by default. Django uses the template loaders in order ac

template.loaders.filesystem.Loader

class filesystem.Loader Loads templates from the filesystem, according to DIRS. This loader is enabled by default. However it won’t find any templates until you set DIRS to a non-empty list: TEMPLATES = [{ 'BACKEND': 'django.template.backends.django.DjangoTemplates', 'DIRS': [os.path.join(BASE_DIR, 'templates')], }] django.template.loaders.app_directories.Loader

template.RequestContext

class RequestContext(request, dict_=None, processors=None) [source] Django comes with a special Context class, django.template.RequestContext, that acts slightly differently from the normal django.template.Context. The first difference is that it takes an HttpRequest as its first argument. For example: c = RequestContext(request, { 'foo': 'bar', }) The second difference is that it automatically populates the context with a few variables, according to the engine’s context_processors conf

template.loaders.base.Loader.load_template()

load_template(template_name, template_dirs=None) [source] Returns a tuple of (template, template_origin), where template is a Template object and template_origin is a string identifying the template source. A filesystem-based loader may return the full path to the file as the template_origin, for example. Deprecated since version 1.9: Custom loaders should use get_template() and get_contents() instead.

template.loaders.base.Loader.get_template_sources()

get_template_sources(template_name) [source] A method that takes a template_name and yields Origin instances for each possible source. For example, the filesystem loader may receive 'index.html' as a template_name argument. This method would yield origins for the full path of index.html as it appears in each template directory the loader looks at. The method doesn’t need to verify that the template exists at a given path, but it should ensure the path is valid. For instance, the filesystem l

template.loaders.base.Loader.get_contents()

get_contents(origin) Returns the contents for a template given a Origin instance. This is where a filesystem loader would read contents from the filesystem, or a database loader would read from the database. If a matching template doesn’t exist, this should raise a TemplateDoesNotExist error.

template.loaders.cached.Loader

class cached.Loader By default, the templating system will read and compile your templates every time they need to be rendered. While the Django templating system is quite fast, the overhead from reading and compiling templates can add up. The cached template loader is a class-based loader that you configure with a list of other loaders that it should wrap. The wrapped loaders are used to locate unknown templates when they are first encountered. The cached loader then stores the compiled Tem

template.loaders.base.Loader.get_template()

get_template(template_name, skip=None) [source] Returns a Template object for a given template_name by looping through results from get_template_sources() and calling get_contents(). This returns the first matching template. If no template is found, TemplateDoesNotExist is raised. The optional skip argument is a list of origins to ignore when extending templates. This allow templates to extend other templates of the same name. It also used to avoid recursion errors. In general, it is enough