Aller au contenu

# Finders

## `GENERATED_ROOT = Path(__file__).parent.resolve() / 'generated'` `module-attribute`

## `IGNORE_PATTERNS_BUNDLED = [f'{BUNDLED_FOLDER_NAME}/*']` `module-attribute`

## `GeneratedFilesFinder(app_names=None, *args, **kwargs)`

Bases: `FileSystemFinder`

Find generated and regular static files

Source code in `staticfiles/finders.py`

    13
    14
    15
    16
    17
    18
    19
    20
    def __init__(self, app_names=None, *args, **kwargs):
        super().__init__(*args, **kwargs)

        # Add GENERATED_ROOT after adding everything in settings.STATICFILES_DIRS
        self.locations.append(("", GENERATED_ROOT))
        generated_storage = FileSystemStorage(location=GENERATED_ROOT)
        generated_storage.prefix = ""
        self.storages[GENERATED_ROOT] = generated_storage