HEX
Server: LiteSpeed
System: Linux php-prod-1.spaceapp.ru 5.15.0-157-generic #167-Ubuntu SMP Wed Sep 17 21:35:53 UTC 2025 x86_64
User: xnsbb3110 (1041)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/local/CyberPanel/lib/python3.10/site-packages/django/apps/__pycache__/config.cpython-310.pyc
o

��h�,�@s^ddlZddlZddlmZddlmZddlmZddlm	Z	m
Z
dZdZGdd	�d	�Z
dS)
�N)�
import_module)�ImproperlyConfigured)�cached_property)�
import_string�module_has_submodule�apps�modelsc@speZdZdZdd�Zdd�Zedd��Zedd	��Z	d
d�Z
edd
��Zddd�Z
ddd�Zdd�Zdd�ZdS)�	AppConfigz>Class representing a Django application and its configuration.cCs�||_||_d|_t|d�s|�d�d|_|j��s"td|j��t|d�s-|j��|_	t|d�s8|�
|�|_d|_d|_
dS)N�label�.�z4The app label '%s' is not a valid Python identifier.�verbose_name�path)�name�moduler�hasattr�
rpartitionr
�isidentifierr�titler
�_path_from_moduler�
models_moduler)�self�app_name�
app_module�r�H/usr/local/CyberPanel/lib/python3.10/site-packages/django/apps/config.py�__init__s

�


zAppConfig.__init__cCsd|jj|jfS)Nz<%s: %s>)�	__class__�__name__r
�rrrr�__repr__:szAppConfig.__repr__cCsddlm}|jS)Nr)�settings)�django.confr!�DEFAULT_AUTO_FIELD)rr!rrr�default_auto_field=szAppConfig.default_auto_fieldcCs|jjtjuS)N)rr$r	rrrr�!_is_default_auto_field_overriddenCsz+AppConfig._is_default_auto_field_overriddencCs�tt|dg��}t|�dkr&t|dd�}|dur tj�|�g}ntt|��}t|�dkr4td||f��|s<td|��|dS)z;Attempt to determine app's filesystem path from its module.�__path__��__file__Nz�The app module %r has multiple filesystem locations (%r); you must configure this app with an AppConfig subclass with a 'path' class attribute.z�The app module %r has no filesystem location, you must configure this app with an AppConfig subclass with a 'path' class attribute.r)�list�getattr�len�osr�dirname�setr)rr�paths�filenamerrrrGs&����zAppConfig._path_from_modulecsd}d}d}zt|�}Wn	tyYn^wt|t�rkd|tf}t|�}�fdd�t�|tj�D�}t|�dkr@|dd}n+dd�|D�}t|�dkr_dd�|D�}td	|d
�	|�f��t|�dkrk|dd}|durs�}|}|dur�zt
|�}Wn	ty�Ynw|dur�|dur�|�d�\}}	}
|r�|
d��r�t|�}�fdd�t�|tj�D�}d
||
f}|r�|dd
�	|�7}t
|��t|�t|t�s�td|��|dur�z|j}Wn
ty�td|��wzt|�}Wnt
�ytd||j|jf��w|||�S)zU
        Factory that creates an app config from an entry in INSTALLED_APPS.
        N�%s.%scs6g|]\}}t|��r|�urt|dd�r||f�qS)�defaultT)�
issubclassr*��.0r�	candidate��clsrr�
<listcomp>~s�
��z$AppConfig.create.<locals>.<listcomp>r'rcSs$g|]\}}t|dd�r||f�qS)r2F)r*r4rrrr9�s
��cSsg|]\}}t|��qSr)�repr)r5r�_rrrr9�sz0%r declares more than one default AppConfig: %s.z, rcs*g|]\}}t|��r|�urt|��qSr)r3r:r4r7rrr9�s��z*Module '%s' does not contain a '%s' class.z Choices are: %s.z#'%s' isn't a subclass of AppConfig.z"'%s' must supply a name attribute.z7Cannot import '%s'. Check that '%s.%s.name' is correct.)r�	Exceptionr�APPS_MODULE_NAME�inspect�
getmembers�isclassr+�RuntimeError�joinrr�isupper�ImportErrorr3r	rr�AttributeError�
__module__�__qualname__)r8�entry�app_config_classrr�mod_path�mod�app_configs�
candidatesr;�cls_name�msgrr7r�createcs��
	
�	����
��

�����
zAppConfig.createTcCsL|r|j��n|j��z|j|��WSty%td|j|f��w)z�
        Return the model with the given case-insensitive model_name.

        Raise LookupError if no model exists with this name.
        z#App '%s' doesn't have a '%s' model.)r�check_models_ready�check_apps_readyr�lower�KeyError�LookupErrorr
)r�
model_name�
require_readyrrr�	get_model�s
��zAppConfig.get_modelFccsB�|j��|j��D]}|jjr|sq|jjr|sq|VqdS)a�
        Return an iterable of models.

        By default, the following models aren't included:

        - auto-created models for many-to-many relations without
          an explicit intermediate table,
        - models that have been swapped out.

        Set the corresponding keyword argument to True to include such models.
        Keyword arguments aren't documented; they're a private API.
        N)rrQr�values�_meta�auto_created�swapped)r�include_auto_created�include_swapped�modelrrr�
get_models�s�

�zAppConfig.get_modelscCs<|jj|j|_t|jt�rd|jtf}t|�|_	dSdS)Nr1)
r�
all_modelsr
rrr�MODELS_MODULE_NAMErrr)r�models_module_namerrr�
import_modelss
�zAppConfig.import_modelscCsdS)zT
        Override this method in subclasses to run code when Django starts.
        Nrrrrr�readyszAppConfig.readyN)T)FF)rrFrG�__doc__rr rr$�propertyr%r�classmethodrPrXr`rdrerrrrr	
s*



|
	r	)r>r,�	importlibr�django.core.exceptionsr�django.utils.functionalr�django.utils.module_loadingrrr=rbr	rrrr�<module>s