
    `?iS
                     t    d Z ddlZddlm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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_nonce	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    t/home/cursorai/projects/django-cronjob-utils/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>2   s      .4?qKN**Ks   )list	itertoolschainfrom_iterabler   s   r   <lambda>zdebug.<locals>.<lambda>1   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   i18nr3   ;   s2    ( ''$113$668 r   c                 2    ddl m} d|j                         iS )Nr   )timezone	TIME_ZONE)r0   r5   get_current_timezone_name)r   r5   s     r   tzr8   E   s    %;;=>>r   c                 &    dt         j                  iS )z>
    Add static-related context variables to the context.
    
STATIC_URL)r   r:   r   s    r   staticr<   K   s     (--..r   c                 &    dt         j                  iS )z=
    Add media-related context variables to the context.
    	MEDIA_URL)r   r>   r;   s    r   mediar?   R   s     ++,,r   c                 
    d| iS )Nr    r;   s    r   r   r   Y   s    wr   c                     dt        |       iS )z+
    Add the CSP nonce to the context.
    	csp_noncer   r;   s    r   csprD   ]   s     7+,,r   )__doc__r    django.confr   django.middleware.cspr   django.middleware.csrfr   django.utils.functionalr   r	   r   r   r3   r8   r<   r?   r   rD   rA   r   r   <module>rJ      sC       + , :6&,?/- -r   