#NEWLINE# @ staticmethod #NEWLINE# @ lru_cache . lru_cache ( ) #NEWLINE# def get_default( ) : #NEWLINE# #INDENT# '\n        When only one DjangoTemplates backend is configured, returns it.\n\n        Raises ImproperlyConfigured otherwise.\n\n        This is required for preserving historical APIs that rely on a\n        globally available, implicitly configured engine such as:\n\n        >>> from django.template import Context, Template\n        >>> template = Template("Hello {{ name }}!")\n        >>> context = Context({\'name\': "world"})\n        >>> template.render(context)\n        \'Hello world!\'\n        ' #NEWLINE# from django.template import engines #NEWLINE# from django.template.backends.django import DjangoTemplates #NEWLINE# django_engines = [ engine for engine in engines . all ( ) if isinstance ( engine , DjangoTemplates ) ] #NEWLINE# if ( len ( engine ) == 1 ) : #NEWLINE# #INDENT# return django_engines [ 0 ] . engine #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( len ( django_engines ) == 0 ) : #NEWLINE# #INDENT# raise ImproperlyConfigured ( 'No DjangoTemplates backend is configured.' ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise ImproperlyConfigured ( 'Several DjangoTemplates backends are configured. You must select one explicitly.' )