def load_template(self, template_name, template_dirs=None): extension = splitext(template_name)[1] if not extension in JINJA2_DEFAULT_TEMPLATE_EXTENSION: return super(LoaderMixin, self).load_template(template_name, template_dirs) template = env.get_template(template_name) return template, template.filename
def load_template(self, template_name, template_dirs=None): extension = splitext(template_name)[1] if not extension in JINJA2_DEFAULT_TEMPLATE_EXTENSION: return super(LoaderMixin, self).load_template(template_name, template_dirs) template = env.get_template(template_name) return template, template.filename
def get_template(template_name): # Jinja will handle this for us, and env also initializes # the loader backends the first time it is called. from coffin.common import env try: return env.get_template(template_name) except TemplateNotFound: raise TemplateDoesNotExist(template_name)
def load_template(self, template_name, template_dirs=None): """Load a jinja2 file if it ends with the specified ending.""" jinja2_ending = getattr(settings, 'JINJA2_FILE_EXTENSION', '.jinja2') if template_name.endswith(jinja2_ending): template = env.get_template(template_name) return template, template.filename else: raise TemplateDoesNotExist(template_name)
def load_template(self, template_name, template_dirs=None): extension = splitext(template_name)[1] if not extension in JINJA2_DEFAULT_TEMPLATE_EXTENSION: return super(LoaderMixin, self).load_template(template_name, template_dirs) try: template = env.get_template(template_name) except TemplateNotFound: raise TemplateDoesNotExist return template, template.filename
def load_template(self, template_name, template_dirs=None): if not template_name.endswith(JINJA2_DEFAULT_TEMPLATE_EXTENSION): return super(LoaderMixin, self).load_template(template_name, template_dirs) template = env.get_template(template_name) return template, template.filename
def get_template(template_name): # Jinja will handle this for us, and env also initializes # the loader backends the first time it is called. from coffin.common import env return env.get_template(template_name)
def get_template(template_name): # Jinja will handle this for us, and env also initializes # the loader backends the first time it is called. from coffin.common import env return env.get_template(template_name)
def load_template(self, template_name, template_dirs=None): if not template_name.endswith(JINJA2_DEFAULT_TEMPLATE_EXTENSION): return super(LoaderMixin, self).load_template(template_name, template_dirs) template = env.get_template(template_name) return template, template.filename