
    af
                     T    d dl mZmZ d dlmZ d dlmZ d dlmZ  G d d          Z	dS )    )ImproperlyConfiguredSuspiciousFileOperation)get_app_template_dirs)	safe_join)cached_propertyc                   R    e Zd Zd Zed             Zd Zd Zed             Z	d Z
dS )
BaseEnginec                 R   |                                 }|                    d          | _        t          |                    d                    | _        |                    d          | _        |r5t          d                    d                    |                              dS )zh
        Initialize the template engine.

        `params` is a dict of configuration settings.
        NAMEDIRSAPP_DIRSzUnknown parameters: {}z, N)	copypopnamelistdirsapp_dirsr   formatjoin)selfparamss     O/var/www/html/env/lib/python3.11/site-packages/django/template/backends/base.py__init__zBaseEngine.__init__   s     JJv&&	F++,,	

:.. 	&(//		&0A0ABB  	 	    c                 Z    t          d                    | j        j                            )NzA{} doesn't support loading templates from installed applications.)r   r   	__class____name__)r   s    r   app_dirnamezBaseEngine.app_dirname   s+    ""F4>#:;;
 
 	
r   c                      t          d          )zk
        Create and return a template for the given source code.

        This method is optional.
        z>subclasses of BaseEngine should provide a from_string() methodNotImplementedError)r   template_codes     r   from_stringzBaseEngine.from_string!   s     "L
 
 	
r   c                      t          d          )z
        Load and return a template for the given name.

        Raise TemplateDoesNotExist if no such template exists.
        z=subclasses of BaseEngine must provide a get_template() methodr    )r   template_names     r   get_templatezBaseEngine.get_template+   s     "K
 
 	
r   c                 j    t          | j                  }| j        r|t          | j                  z  }|S )zG
        Return a list of directories to search for templates.
        )tupler   r   r   r   )r   template_dirss     r   r)   zBaseEngine.template_dirs8   s:     di((= 	E243CDDDMr   c              #   d   K   | j         D ]%}	 t          ||          V  # t          $ r Y "w xY wdS )z
        Iterate over candidate files for template_name.

        Ignore files that don't lie inside configured template dirs to avoid
        directory traversal attacks.
        N)r)   r   r   )r   r%   template_dirs      r   iter_template_filenamesz"BaseEngine.iter_template_filenamesC   sd       !. 	 	Lm<<<<<<*    	 	s    
--N)r   
__module____qualname__r   propertyr   r#   r&   r   r)   r,    r   r   r	   r	      s           
 
 X

 
 

 
 
   _    r   r	   N)
django.core.exceptionsr   r   django.template.utilsr   django.utils._osr   django.utils.functionalr   r	   r0   r   r   <module>r5      s    P P P P P P P P 7 7 7 7 7 7 & & & & & & 3 3 3 3 3 3I I I I I I I I I Ir   