
    h]                     x    S SK r S SKJr  S SKJr  S SKJr  SSKJr  SSK	J
r
Jr  SSKJr  SS	KJr   " S
 S5      rg)    N)ImproperlyConfigured)cached_propertyimport_string   Template)Context_builtin_context_processors)TemplateDoesNotExistimport_libraryc                       \ rS rSr/ SQr          SS jrS r\\R                  S 5       5       r
\S 5       rS rS	 r\S
 5       rS rS rSS jrS rS rSS jrS rSrg)Engine   )zdjango.template.defaulttagszdjango.template.defaultfilterszdjango.template.loader_tagsNc                    Uc  / nUc  / nUc  S/nU(       a  US/-  nSU4/nOU(       a  [        S5      eUc  0 nU	c  / n	Xl        X l        Xl        X0l        X@l        XPl        X`l        Xpl        Xl	        U R                  U5      U l        U R                  U	-   U l        U R                  U R                  5      U l        g )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              H/var/www/html/env/lib/python3.13/site-packages/django/template/engine.py__init__Engine.__init__   s     <D%!#?BCGLMM?IJG*G  IH	 $"4
!2(""&"="=i"H--8!%!;!;DMM!J    c                    SU R                   R                  < SU R                  (       d  SOS[        U R                  5      -  < SU R                  < U R
                  (       d  SOS[        U R
                  5      -  < SU R                  < S[        U R                  5      < S	[        U R                  5      < S
[        U R                  5      < U R                  (       d  SOS[        U R                  5      -  < U R                  (       d  SOS[        U R                  5      -  < S[        U R                  5      < S3$ )N<: z dirs=%sz
 app_dirs=z context_processors=%sz debug=z	 loaders=z string_if_invalid=z file_charset=z libraries=%sz builtins=%sz autoescape=>)	__class____qualname__r   reprr   r   r   r   r   r   r   r   r   r"   s    r#   __repr__Engine.__repr__A   s    
 NN''iiBZ$tyy/%AAMM .. -T5L5L0MMN JJ''(""#nnB/D<P*PPmmB$t}}:M)MM!%
 	
r&   c                      SSK Jn   SSKJn  U R	                  5        H!  n[        X!5      (       d  M  UR                  s  $    [        S5      e)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.templater3   django.template.backends.djangor4   all
isinstanceenginer   )r3   r4   r9   s      r#   get_defaultEngine.get_defaultW   s=    & 	,CkkmF&22}}$ $ ##NOOr&   c                 b    [         nU[        U R                  5      -  n[        S U 5       5      $ )Nc              3   8   #    U  H  n[        U5      v   M     g 7fNr   ).0paths     r#   	<genexpr>5Engine.template_context_processors.<locals>.<genexpr>v   s     H5GT]4((5Gs   )r   tupler   )r"   r   s     r#   template_context_processors"Engine.template_context_processorsr   s0    8eD$;$;<<H5GHHHr&   c                 D    U Vs/ s H  n[        U5      PM     sn$ s  snf r>   r   )r"   r   xs      r#   r    Engine.get_template_builtinsx   s    +348aq!8444s   c                 V    0 nUR                  5        H  u  p4[        U5      X#'   M     U$ r>   )itemsr   )r"   r   loadednamer@   s        r#   r   Engine.get_template_libraries{   s+    #//+JD)$/FL ,r&   c                 8    U R                  U R                  5      $ r>   )get_template_loadersr   r/   s    r#   template_loadersEngine.template_loaders   s    ((66r&   c                 j    / nU H*  nU R                  U5      nUc  M  UR                  U5        M,     U$ r>   )find_template_loaderappend)r"   rP   r   template_loaderloaders        r#   rO   Engine.get_template_loaders   s:    /O..?F!v&  0 r&   c                     [        U[        [        45      (       a  UtpO/ n[        U[        5      (       a  [	        U5      nU" U /UQ76 $ [        SU-  5      e)Nz3Invalid value in template loaders configuration: %r)r8   rC   liststrr   r   )r"   rV   argsloader_classs       r#   rS   Engine.find_template_loader   s]    fudm,,"MFTDfc""(0L,t,,&EN r&   c                     / nU R                    H   n UR                  XS9nXfR                  4s  $    [        XS9e! [         a&  nUR	                  UR
                  5         S nAMX  S nAff = f)N)skip)tried)rP   get_templateoriginr   extendr`   )r"   rL   r   r_   r`   rV   templatees           r#   find_templateEngine.find_template   sn    ++F&!..t.?00 , #455 ( &QWW%%&s   <
A,A''A,c                     [        XS9$ )zk
Return a compiled Template object for the given template code,
handling template inheritance recursively.
r9   r   )r"   template_codes     r#   from_stringEngine.from_string   s    
 33r&   c                 b    U R                  U5      u  p#[        US5      (       d
  [        X#XS9nU$ )zk
Return a compiled Template object for the given template name,
handling template inheritance recursively.
renderri   )rf   hasattrr	   )r"   template_namerd   rb   s       r#   ra   Engine.get_template   s5    
  --m<x**-MHr&   c                    [        U[        [        45      (       a  U R                  U5      nOU R	                  U5      n[        U[
        5      (       a  UR                  U5      $ UR                  [        X R                  S95      $ )zh
Render the template specified by template_name with the given context.
For use in Django's test suite.
)r   )r8   rY   rC   select_templatera   r
   rn   r   )r"   rp   contextts       r#   render_to_stringEngine.render_to_string   sk    
 mdE]33$$]3A!!-0A gw''88G$$88GGHIIr&   c                 &   U(       d  [        S5      e/ nU H  n U R                  U5      s  $    [        SR	                  U5      5      e! [          a<  nUR                  S   U;  a  UR                  UR                  S   5         SnAMt  SnAff = f)zF
Given a list of template names, return the first that can be loaded.
zNo template names providedr   Nz, )r   ra   r[   rT   join)r"   template_name_list	not_foundrp   excs        r#   rs   Engine.select_template   s     "&'CDD	/M((77 0 #499Y#788 ( 88A;i/$$SXXa[1s   A


B1BB)r   r   r   r   r   r   r   r   r   r   r!   r   )
NFNFNr*   zutf-8NNT)NNr>   )__name__
__module__r-   __firstlineno__r   r$   r0   staticmethod	functools	lru_cacher:   r   rD   r    r   rP   rO   rS   rf   rk   ra   rv   rs   __static_attributes__ r&   r#   r   r      s     +KZ
, P  P2 I I
5 7 764	J 9r&   r   )r   django.core.exceptionsr   django.utils.functionalr   django.utils.module_loadingr   baser	   rt   r
   r   
exceptionsr   libraryr   r   r   r&   r#   <module>r      s)     7 3 5  9 , #I9 I9r&   