o a @sddlZddlmZddlmZmZddlmZddlm Z m Z m Z m Z e dedd Z e e jd d Ze e jd d ddZe e jddZdS)N)settings)DEFAULT_CACHE_ALIAScaches)FileBasedCache)ErrorTagsWarningregisterz4You must define a '%s' cache in your CACHES setting.z caches.E001idcKsttjvrtgSgSN)rrCACHESE001) app_configskwargsr;/usr/lib/python3/dist-packages/django/core/checks/caches.py!check_default_cache_is_configureds rT)deployc s$g}dD]}tt|d}|sq|dkr1t}|D]}t|ttfr%|\}}|t| qnt| h}tj D]R}t |} t| t sHq*sz3check_cache_location_not_exposed..matchesc3s|]}|jvVqdSr parentsrrrrr,z is insidec3s|]}|jvVqdSr r rrrrr.r"containsYour 'zf' cache configuration might expose your cache or lead to corruption of your data because its LOCATION  .z caches.W002r )getattrrset isinstancelisttupleaddpathlibPathresolverrr_diranyappendr ) rrerrorsnamesettingpathsstaticfiles_dir_aliascacherelationrrr check_cache_location_not_exposedsF    r<cKs\g}tjD]$\}}t|}t|tsqt|ds+| t d|dddq|S)NLOCATIONr$z@' cache LOCATION path is relative. Use an absolute path instead.z caches.W003r ) rritemsrr)rr-r. is_absoluter2r )rrr3r9configr:rrr"check_file_based_cache_is_absolute;s  rA)r- django.confrdjango.core.cacherr$django.core.cache.backends.filebasedrrrr r rrr<rArrrrs     $