https://t.me/RX1948
Server : Apache
System : Linux iad1-shared-b8-43 6.6.49-grsec-jammy+ #10 SMP Thu Sep 12 23:23:08 UTC 2024 x86_64
User : dh_edsupp ( 6597262)
PHP Version : 8.2.26
Disable Function : NONE
Directory :  /lib/python3/dist-packages/django/apps/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //lib/python3/dist-packages/django/apps/__pycache__/config.cpython-310.pyc
o

3�a�3�@srddlZddlZddlZddlmZddlmZddlmZddl	m
Z
ddlmZm
Z
dZdZGd	d
�d
�ZdS)�N)�
import_module)�ImproperlyConfigured)�RemovedInDjango41Warning)�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�4/usr/lib/python3/dist-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
r rrr�!_is_default_auto_field_overriddenDsz+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�filenamerrrrHs&����zAppConfig._path_from_modulecs�d}d}d}d}zt|�}Wn	tyYn�wt|t�r�d|tf}t|�}�fdd�t�|tj�D�}t|�dkrL|dd}d||ddf}n5dd�|D�}t|�dkrkdd�|D�}	td	|d
�	|	�f��t|�dkr�|dd}d||ddf}z|j
}
Wnty�|dur��}|}Yn(wd||
f}|
|kr�|d7}n|d
|r�d|nd7}tj
|tdd�|
}d}|dur�zt|�}Wn	ty�Ynw|du�r|du�r|�d�\}}}
|�r|
d���rt|�}�fdd�t�|tj�D�}	d||
f}|	�r|dd
�	|	�7}t|��t|�t|t��s'td|��|du�r@z|j}Wnt�y?td|��wzt|�}Wnt�yYtd||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)r3F)r+r5rrrr:�s
��cSsg|]\}}t|��qSr)�repr)r6r�_rrrr:�sz0%r declares more than one default AppConfig: %s.z, z$%r defines default_app_config = %r. zWDjango now detects this configuration automatically. You can remove default_app_config.z�However, Django's automatic detection %s. You should move the default config class to the apps submodule of your application and, if this module defines several config classes, mark the default one with default = True.z picked another configuration, %rzdid not find this configurationr
)�
stacklevelrcs*g|]\}}t|��r|�urt|��qSr)r4r;r5r8rrr:�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�join�default_app_config�AttributeError�warnings�warnrrr�isupper�ImportErrorr4r
rr�
__module__�__qualname__)r9�entry�app_config_class�app_config_namerr�mod_path�mod�app_configs�
candidates�	new_entry�messager<�cls_name�msgrr8r�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_models
��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)rrYr	�values�_meta�auto_created�swapped)r�include_auto_created�include_swapped�modelrrr�
get_modelss�

�zAppConfig.get_modelscCs<|jj|j|_t|jt�rd|jtf}t|�|_	dSdS)Nr2)
r�
all_modelsrr	rr�MODELS_MODULE_NAMErrr)r�models_module_namerrr�
import_models&s
�zAppConfig.import_modelscCsdS)zT
        Override this method in subclasses to run code when Django starts.
        Nrr rrr�ready/szAppConfig.readyN)T)FF)rrKrL�__doc__rr!rr%�propertyr&r�classmethodrXr`rhrlrmrrrrr
s *




	r
)r@r-rG�	importlibr�django.core.exceptionsr�django.utils.deprecationr�django.utils.functionalr�django.utils.module_loadingrrr?rjr
rrrr�<module>s

https://t.me/RX1948 - 2025