
    EvgS
                        d dl Z d dlmZ d dlmZmZ d dlmZ ddlm	Z	m
Z
mZmZ  e	dez  d	          Z ee
j                  d
             Z ee
j        d          d             Z ee
j                  d             ZdS )    N)settings)DEFAULT_CACHE_ALIAScaches)FileBasedCache   )ErrorTagsWarningregisterz4You must define a '%s' cache in your CACHES setting.zcaches.E001idc                 <    t           t          j        vrt          gS g S N)r   r   CACHESE001)app_configskwargss     V/var/www/pixelcanvas.ch/venv/lib/python3.11/site-packages/django/core/checks/caches.py!check_default_cache_is_configuredr      s    (/11vI    T)deployc                 N   g }dD ]}t          t          |d           }|s|dk    rnt                      }|D ]\}t          |t          t
          f          r|\  }}|                    t          j        |          	                                           ]n't          j        |          	                                h}t          j
        D ]}t          |         }	t          |	t                    s%t          j        |	j                  	                                t          fd|D                       rd}
n=t          fd|D                       rd}
nt          fd|D                       rd}
n|                    t!          d	| d
|
 d| dd                     ڐ|S )N)
MEDIA_ROOTSTATIC_ROOTSTATICFILES_DIRSr   c              3   $   K   | ]
}|k    V  d S r    .0path
cache_paths     r   	<genexpr>z3check_cache_location_not_exposed.<locals>.<genexpr>*   s(      88$4:%888888r   matchesc              3   *   K   | ]}|j         v V  d S r   parentsr   s     r   r"   z3check_cache_location_not_exposed.<locals>.<genexpr>,   s+      BBDTZ//BBBBBBr   z	is insidec              3   *   K   | ]}|j         v V  d S r   r%   r   s     r   r"   z3check_cache_location_not_exposed.<locals>.<genexpr>.   s*      BBDZ4</BBBBBBr   containsYour 'zf' cache configuration might expose your cache or lead to corruption of your data because its LOCATION  .zcaches.W002r   )getattrr   set
isinstancelisttupleaddpathlibPathresolver   r   r   _diranyappendr
   )r   r   errorsnamesettingpathsstaticfiles_dir_aliascacherelationr!   s              @r    check_cache_location_not_exposedrA      s   FA    (D$// 	%%%EEE#* C Coe}== 9)8&A		',77??AABBBBC
 \'**22445E_ 	 	E5MEe^44  ej1199;;J8888%88888 $BBBBEBBBBB &BBBBEBBBBB %MM*U * ** *"&* * * %	     	* Mr   c                 @   g }t           j                                        D ]|\  }}t          |         }t	          |t
                    s(t          j        |d                                                   s(|	                    t          d| dd                     }|S )NLOCATIONr)   z@' cache LOCATION path is relative. Use an absolute path instead.zcaches.W003r   )r   r   itemsr   r.   r   r2   r3   is_absoluter7   r
   )r   r   r8   r>   configr?   s         r   "check_file_based_cache_is_absoluterG   =   s    F!..00  vu%00 	|F:.//;;== 	MM.U . . .$     Mr   )r2   django.confr   django.core.cacher   r   $django.core.cache.backends.filebasedr    r   r	   r
   r   r   r   rA   rG   r   r   r   <module>rL      s                9 9 9 9 9 9 9 9 ? ? ? ? ? ? , , , , , , , , , , , ,u:=PP   
$+   
$+d#### # $##L 
$+    r   