MCPcopy
hub / github.com/django/django / get_template

Method get_template

django/template/backends/jinja2.py:40–48  ·  view source on GitHub ↗
(self, template_name)

Source from the content-addressed store, hash-verified

38 return Template(self.env.from_string(template_code), self)
39
40 def get_template(self, template_name):
41 try:
42 return Template(self.env.get_template(template_name), self)
43 except jinja2.TemplateNotFound as exc:
44 raise TemplateDoesNotExist(exc.name, backend=self) from exc
45 except jinja2.TemplateSyntaxError as exc:
46 new = TemplateSyntaxError(exc.args)
47 new.template_debug = get_exception_info(exc)
48 raise new from exc
49
50 @cached_property
51 def template_context_processors(self):

Callers 1

test_dirs_pathlibMethod · 0.95

Calls 4

TemplateSyntaxErrorClass · 0.90
get_exception_infoFunction · 0.85
TemplateClass · 0.70

Tested by 1

test_dirs_pathlibMethod · 0.76