← Back
Editing: engine.cpython-311.pyc
� �|�e� � � � d dl Z d dlmZ d dlmZ d dlmZ ddlmZ ddl m Z mZ ddlm Z dd lmZ G d � d� � ZdS )� N)�ImproperlyConfigured)�cached_property�� import_string� ��Template)�Context�_builtin_context_processors)�TemplateDoesNotExist��import_libraryc �� � e Zd Zg d�Z dd�Ze ej � � d� � � � � Ze d � � � Z d � Zd� Ze d� � � Z d � Zd� Zdd�Zd� Zd� Zdd�Zd� ZdS )�Engine)zdjango.template.defaulttagszdjango.template.defaultfilterszdjango.template.loader_tagsNF� �utf-8Tc � � |�g }|�g }|�dg}|r|dgz }|sd|fg}n|rt d� � �|�i }| �g } || _ || _ | | _ || _ || _ || _ || _ || _ || _ | � |� � | _ | j | z | _ | � | j � � | _ d S )Nz)django.template.loaders.filesystem.Loaderz.django.template.loaders.app_directories.Loaderz%django.template.loaders.cached.Loaderz1app_dirs must not be set when loaders is defined.)r �dirs�app_dirs� autoescape�context_processors�debug�loaders�string_if_invalid�file_charset� libraries�get_template_libraries�template_libraries�default_builtins�builtins�get_template_builtins�template_builtins)�selfr r r r r r r r r r s �8/usr/lib/python3/dist-packages/django/template/engine.py�__init__zEngine.__init__ s � � �<��D��%�!#���?�B�C�G�� N��L�M�M��� O�C�W�M�N���� I�*�G�I� I� I����I����H��� � �� �$���"4����� ����!2���(���"���"&�"=�"=�i�"H�"H����-��8�� �!%�!;�!;�D�M�!J�!J����� c � � ddl m} ddlm} | � � � D ]}t ||� � r |j c S �t d� � �)a� Return the first DjangoTemplates backend that's configured, or raise ImproperlyConfigured if none are configured. This is required for preserving historical APIs that rely on a globally available, implicitly configured engine such as: >>> from django.template import Context, Template >>> template = Template("Hello {{ name }}!") >>> context = Context({'name': "world"}) >>> template.render(context) 'Hello world!' r )�engines)�DjangoTemplatesz)No DjangoTemplates backend is configured.)�django.templater( �django.template.backends.djangor) �all� isinstance�enginer )r( r) r. s r$ �get_defaultzEngine.get_default7 ss � �&