Skip to content

apps

django_spire.file.apps

FileConfig

Bases: AppConfig

default_auto_field = 'django.db.models.BigAutoField' class-attribute instance-attribute

label = 'django_spire_file' class-attribute instance-attribute

name = 'django_spire.file' class-attribute instance-attribute

REQUIRED_APPS = ('django_spire_core',) class-attribute instance-attribute

URLPATTERNS_INCLUDE = 'django_spire.file.urls' class-attribute instance-attribute

URLPATTERNS_NAMESPACE = 'file' class-attribute instance-attribute

ready

Source code in django_spire/file/apps.py
def ready(self) -> None:
    if not hasattr(settings, 'BASE_FOLDER_NAME'):
        message = f'"BASE_FOLDER_NAME" must be set in the django settings when using "{self.label}".'
        raise ValueError(message)

    if not isinstance(settings.BASE_FOLDER_NAME, str):
        message = f'"BASE_FOLDER_NAME" must be a string in the django settings when using "{self.label}".'
        raise TypeError(message)

    check_required_apps(self.label)