a
    Dg
                     @   s   d dl Z d dlZd dlmZmZ d dlmZ d dlmZ d dl	m
Z
 d dlmZ z
ejZW n. ey   ejrtdZneee e ZY n0 ere degeej   dd	 ZndZejd
ddkrdd Zndd ZdS )    N)STATICFILES_STORAGE_ALIASsettings)HashedFilesMixin)storages)static)__version__T    Z WAGTAIL_FAIL_ON_VERSIONED_STATIC01c                 C   s   t dd S )Na  `versioned_static` was called during application startup. This is not valid as it will cause failures if collectstatic has not yet completed (e.g. during the collectstatic command itself). Ensure that any media definitions declared via `class Media` are converted to a `media` property.)	Exception)path r   X/var/www/lab.imftr.de/x/nb_venv/lib/python3.9/site-packages/wagtail/admin/staticfiles.pyversioned_static,   s    r   c                 C   s:   |  dr| S t| }tdu s&d|v r*|S |d t S dS )z
        Wrapper for Django's static file finder to append a cache-busting query parameter
        that updates on each Wagtail version
        )zhttp://zhttps:///N?z?v=)
startswithr   VERSION_HASH)r   base_urlr   r   r   r   5   s    
)hashlibosZdjango.confr   r   Z"django.contrib.staticfiles.storager   Zdjango.core.files.storager   Zdjango.templatetags.staticr   Zwagtailr   Z(WAGTAILADMIN_STATIC_FILE_VERSION_STRINGSZuse_version_stringsAttributeErrorDEBUG
isinstancesha1joinlistZINSTALLED_APPSencode	hexdigestr   environgetr   r   r   r   r   <module>   s0   

	