
    g	                     b    d Z ddlZddlmZ ddlmZ ddlmZmZ d Z	d Z
d Zd	 Zd
 Zd Zd Zy)aR  
A set of request processors that return dictionaries to be merged into a
template context. Each function takes the request object as its only parameter
and returns a dictionary to add to the context.

These are referenced from the 'context_processors' option of the configuration
of a DjangoTemplates backend and used by RequestContext.
    N)settings	get_token)SimpleLazyObjectlazyc                 (      fd}dt        |      iS )z
    Context processor that provides a CSRF token, or the string 'NOTPROVIDED' if
    it has not been provided by either a view decorator or the middleware
    c                  $    t              } | y| S )NNOTPROVIDEDr   )tokenrequests    z/var/www/python.vincentserveurtest.ovh/public_html/venv/lib/python3.12/site-packages/django/template/context_processors.py_get_valzcsrf.<locals>._get_val   s    '"= !L    
csrf_token)r   )r   r   s   ` r   csrfr      s     *8455r   c                     i }t         j                  rL| j                  j                  d      t         j                  v r!d|d<   ddlm t        fdt              |d<   |S )z9
    Return context variables helpful for debugging.
    REMOTE_ADDRTdebugr   connectionsc                  f    t        t        j                  j                   fd D                    S )Nc              3   <   K   | ]  }|   j                     y w)N)queries).0xr   s     r   	<genexpr>z*debug.<locals>.<lambda>.<locals>.<genexpr>1   s      .4?qKN**Ks   )list	itertoolschainfrom_iterabler   s   r   <lambda>zdebug.<locals>.<lambda>0   s)    D-- .4?. r   sql_queries)	r   DEBUGMETAgetINTERNAL_IPS	django.dbr   r   r   )r   context_extrasr   s     @r   r   r   $   s]     N~~',,**=9X=R=RR"&w) )-
 )
}% r   c                 n    ddl m} t        j                  |j	                         |j                         dS )Nr   )translation)	LANGUAGESLANGUAGE_CODELANGUAGE_BIDI)django.utilsr*   r   r+   get_languageget_language_bidi)r   r*   s     r   i18nr1   :   s2    ( ''$113$668 r   c                 2    ddl m} d|j                         iS )Nr   )timezone	TIME_ZONE)r.   r3   get_current_timezone_name)r   r3   s     r   tzr6   D   s    %;;=>>r   c                 &    dt         j                  iS )z>
    Add static-related context variables to the context.
    
STATIC_URL)r   r8   r   s    r   staticr:   J   s     (--..r   c                 &    dt         j                  iS )z=
    Add media-related context variables to the context.
    	MEDIA_URL)r   r<   r9   s    r   mediar=   Q   s     ++,,r   c                 
    d| iS )Nr    r9   s    r   r   r   X   s    wr   )__doc__r   django.confr   django.middleware.csrfr   django.utils.functionalr   r   r   r   r1   r6   r:   r=   r   r?   r   r   <module>rD      s;       , :6&,?/- r   