template.Context.push()

Context.push()

template.Context.pop()

Context.pop()

template.Context.get()

Context.get(key, otherwise=None) Returns the value for key if key is in the context, else returns otherwise.

template.Context.flatten()

Context.flatten() Using flatten() method you can get whole Context stack as one dictionary including builtin variables. >>> c = Context() >>> c['foo'] = 'first level' >>> c.update({'bar': 'second level'}) {'bar': 'second level'} >>> c.flatten() {'True': True, 'None': None, 'foo': 'first level', 'False': False, 'bar': 'second level'} A flatten() method is also internally used to make Context objects comparable. >>> c1 = Context() >>> c1['

template.Context

class Context(dict_=None) [source] This class lives at django.template.Context. The constructor takes two optional arguments: A dictionary mapping variable names to variable values. The name of the current application. This application name is used to help resolve namespaced URLs. If you’re not using namespaced URLs, you can ignore this argument. For details, see Playing with Context objects below.

template.base.Origin.template_name

template_name The relative path to the template as passed into the template loader. If the template is instantiated directly rather than through a template loader, this is None.

template.base.Origin.name

name The path to the template as returned by the template loader. For loaders that read from the file system, this is the full path to the template. If the template is instantiated directly rather than through a template loader, this is a string value of <unknown_source>.

template.base.Origin

class Origin [source] name The path to the template as returned by the template loader. For loaders that read from the file system, this is the full path to the template. If the template is instantiated directly rather than through a template loader, this is a string value of <unknown_source>. template_name The relative path to the template as passed into the template loader. If the template is instantiated directly rather than through a template loader, this is None.

template.backends.jinja2.Jinja2

class Jinja2 [source] Requires Jinja2 to be installed: $ pip install Jinja2 Set BACKEND to 'django.template.backends.jinja2.Jinja2' to configure a Jinja2 engine. When APP_DIRS is True, Jinja2 engines look for templates in the jinja2 subdirectory of installed applications. The most important entry in OPTIONS is 'environment'. It’s a dotted Python path to a callable returning a Jinja2 environment. It defaults to 'jinja2.Environment'. Django invokes that callable and passes other options as ke

template.backends.django.DjangoTemplates

class DjangoTemplates [source] Set BACKEND to 'django.template.backends.django.DjangoTemplates' to configure a Django template engine. When APP_DIRS is True, DjangoTemplates engines look for templates in the templates subdirectory of installed applications. This generic name was kept for backwards-compatibility. DjangoTemplates engines accept the following OPTIONS: 'autoescape': a boolean that controls whether HTML autoescaping is enabled. It defaults to True. Warning Only set it to False