Skip to content

Incompatibility with ManifestStaticFilesStorage #151

Open
@alice-telescoop

Description

@alice-telescoop

I cannot make ManifestStaticFileStorage` find the compiled css, even though it is on the right place. Here's my config :

STATICFILES_FINDERS = [
    "django.contrib.staticfiles.finders.FileSystemFinder",
    "django.contrib.staticfiles.finders.AppDirectoriesFinder",
    "static_precompiler.finders.StaticPrecompilerFinder",
]
STATICFILES_DIRS = [
    os.path.join(PROJECT_DIR, "static"),
]

# subclassing is to avoid ValueError but the file still isn't found
class LenientManifestStaticFileStorage(ManifestStaticFilesStorage):
    manifest_strict = False


STATICFILES_STORAGE = "labo.settings.base.LenientManifestStaticFileStorage"

The error I get when I let manifest_strict to True is:

/django/contrib/staticfiles/storage.py", line 465, in stored_name
    raise ValueError(
ValueError: Missing staticfiles manifest entry for 'COMPILED/css/pagination.css'

Indeed, there is mention of pagination.scss in staticfiles.json but none of COMPILED/pagination.css

ManifestStaticFilesStorage is the file storage system that is recommended in production and that's why we chose it. Also, the error only appears on DEBUG=True, but that is not too surprising since it is when ManifestStaticFilesStorage is actually used.

If anyone has an idea it would help a lot. I don't know if I missed anything, if someone has a workaround, if it was supposed to be supported at all.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions