this module contains generic exceptions used by template backends although due to historical reasons the django template language also internally uses these exceptions other exceptions specific to the dtl should not be added here the exception used when a template does not exist optional arguments backend the template backend class used when raising this exception tried a list of sources that were tried when finding the template this is formatted as a list of tuples containing origin status where origin is an origin object or duck type and status is a string with the reason the template wasn t found chain a list of intermediate templatedoesnotexist exceptions this is used to encapsulate multiple exceptions when loading templates from multiple engines the exception used for syntax errors during parsing or rendering the exception used when a template does not exist optional arguments backend the template backend class used when raising this exception tried a list of sources that were tried when finding the template this is formatted as a list of tuples containing origin status where origin is an origin object or duck type and status is a string with the reason the template wasn t found chain a list of intermediate templatedoesnotexist exceptions this is used to encapsulate multiple exceptions when loading templates from multiple engines the exception used for syntax errors during parsing or rendering
class TemplateDoesNotExist(Exception):
    

    def __init__(self, msg, tried=None, backend=None, chain=None):
        self.backend = backend
        if tried is None:
            tried = []
        self.tried = tried
        if chain is None:
            chain = []
        self.chain = chain
        super().__init__(msg)


class TemplateSyntaxError(Exception):
    

    pass