File manager - Edit - /usr/local/CyberPanel/lib/python3.10/site-packages/django/apps/__pycache__/config.cpython-310.pyc
Back
o �h�, � @ s^ d dl Z d dlZd dlmZ d dlmZ d dlmZ d dlm Z m Z dZdZG dd � d �Z dS ) � N)� import_module)�ImproperlyConfigured)�cached_property)� import_string�module_has_submodule�apps�modelsc @ sp e Zd ZdZdd� Zdd� Zedd� �Zedd � �Z d d� Z edd � �Zddd�Z ddd�Zdd� Zdd� ZdS )� AppConfigz>Class representing a Django application and its configuration.c C s� || _ || _d | _t| d�s|�d�d | _| j�� s"td| j ��t| d�s-| j�� | _ t| d�s8| � |�| _d | _d | _ d S )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__c C s d| j j| jf S )Nz<%s: %s>)� __class__�__name__r �r r r r �__repr__: s zAppConfig.__repr__c C s ddl m} |jS )Nr )�settings)�django.confr! �DEFAULT_AUTO_FIELD)r r! r r r �default_auto_field= s zAppConfig.default_auto_fieldc C s | j jtjuS )N)r r$ r r r r r �!_is_default_auto_field_overriddenC s z+AppConfig._is_default_auto_field_overriddenc C s� t t|dg ��}t|�dkr&t|dd�}|dur tj�|�g}nt t|��}t|�dkr4td||f ��|s<td| ��|d S )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 )r r �paths�filenamer r r r G s&