Example #1
0
    def load_template(self, template_name, template_dirs=None):
        app_directories_loader = AppDirectoriesLoader()
        for skip_path in getattr(settings, 'KEEP_DJANGO_TEMPLATES', []):
            # Hackish way to use Django Loader for Django Admin
            if skip_path in template_name:
                return app_directories_loader(template_name, template_dirs)

        if not template_name.endswith(DEFAULT_JINJA2_TEMPLATE_EXTENSION):
            return super(LoaderMixin,
                         self).load_template(template_name, template_dirs)

        try:
            template = env.get_template(template_name)
            return template, template.filename
        except jinja2.TemplateNotFound:
            raise TemplateDoesNotExist(template_name)
Example #2
0
 def __init__(self):
     MakoLoader.__init__(self, AppDirectoriesLoader())
Example #3
0
 def __init__(self, *args):
     MakoLoader.__init__(self, AppDirectoriesLoader(*args))
Example #4
0
 def __init__(self, *args):
     MakoLoader.__init__(self, AppDirectoriesLoader(*args))  # lint-amnesty, pylint: disable=no-value-for-parameter