Aller au contenu

Finders

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

IGNORE_PATTERNS_WEBPACK = ['webpack/*'] module-attribute

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

Bases: FileSystemFinder

Find generated and regular static files

Source code in staticfiles/finders.py
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