Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alternative to PipelineCachedStorage in Django-3.1? #740

Open
ngkabra opened this issue Dec 30, 2020 · 4 comments
Open

Alternative to PipelineCachedStorage in Django-3.1? #740

ngkabra opened this issue Dec 30, 2020 · 4 comments

Comments

@ngkabra
Copy link

ngkabra commented Dec 30, 2020

PipelineCachedStorage is not supported for Django-3.1+. The documentation has no mention of this (although the release notes do).

What is the suggested alternative in case someone wants to recreate the same behavior? Does PipelineManifestStorage do pretty much the same thing? What are the differences between the two?

(I'm a little confused because the documentation mentions PipelineManifestStorage in some places and PipelineCachedStorage in other places without any indication of the relation between the two, if any)

@Pyvonix
Copy link

Pyvonix commented Jan 27, 2021

Hi @ngkabra,

The documentation could be outdate, the best thing is to directly show the code of the storage.py

As you can see PipelineStorage an inherit of StaticFilesStorage and PipelineManifestStorage is an inherit of ManifestStaticFilesStorage (how is a subclass of StaticFilesStorage).
The only thing that brings ManifestStaticFilesStorage compared to StaticFilesStorage is to replace the paths of your files with their hashed counterparts and update the cache appropriately.

Concerning PipelineCachedStorage, it's a subclass of CachedStaticFilesStorage how isn't any more available in Django 3.1.0

Hope this helps you.

@sowinski
Copy link

sowinski commented Jul 6, 2022

Did you find a solution for that? I updated from Django 3.0 to Django 3.1 and get this error:

AttributeError: module 'pipeline.storage' has no attribute 'PipelineCachedStorage'

@Pyvonix
Copy link

Pyvonix commented Jul 6, 2022

Did you find a solution for that? I updated from Django 3.0 to Django 3.1 and get this error:
AttributeError: module 'pipeline.storage' has no attribute 'PipelineCachedStorage'

Did you read my previous answer?

Concerning PipelineCachedStorage, it's a subclass of CachedStaticFilesStorage how isn't any more available in Django 3.1.0

So you can't use PipelineCachedStorage anymore due to Django backend remove the feature. Try to replace it with ManifestStaticFilesStorage class who is more recent.

Note: file docs/usage.rst should be updated at line 91.

@sowinski
Copy link

sowinski commented Jul 8, 2022

@TheBuky Thank you for the fast response.

I replaced it with ManifestStaticFilesStorage but getting this error now:

ValueError: The file 'admin/css/widgets.2753875e2781.d1e228221a7f.css' could not be found with <pipeline.storage.PipelineManifestStorage object at 0x7f7dfdeb1c88>

Any idea what to do now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants