Commit b99e0fb9 by Timothée Peignier

allow to not use CachedFilesStorage

parent dd77612e
try: try:
from django.contrib.staticfiles import finders from django.contrib.staticfiles import finders
from django.contrib.staticfiles.storage import CachedStaticFilesStorage, StaticFilesStorage from django.contrib.staticfiles.storage import CachedFilesMixin, StaticFilesStorage
except ImportError: except ImportError:
from staticfiles import finders from staticfiles import finders
from staticfiles.storage import CachedStaticFilesStorage, StaticFilesStorage from staticfiles.storage import CachedFilesMixin, StaticFilesStorage
from django.core.exceptions import ImproperlyConfigured from django.core.exceptions import ImproperlyConfigured
from django.core.files.storage import get_storage_class from django.core.files.storage import get_storage_class
from django.utils.functional import LazyObject from django.utils.functional import LazyObject
...@@ -39,7 +39,7 @@ class PipelineFinderStorage(BaseFinderStorage): ...@@ -39,7 +39,7 @@ class PipelineFinderStorage(BaseFinderStorage):
finders = finders finders = finders
class PipelineStorage(CachedStaticFilesStorage): class PipelineStorage(StaticFilesStorage):
def post_process(self, paths, dry_run=False, **options): def post_process(self, paths, dry_run=False, **options):
from pipeline.packager import Packager from pipeline.packager import Packager
if dry_run: if dry_run:
...@@ -56,6 +56,10 @@ class PipelineStorage(CachedStaticFilesStorage): ...@@ -56,6 +56,10 @@ class PipelineStorage(CachedStaticFilesStorage):
return super(PipelineStorage, self).post_process(paths, dry_run, **options) return super(PipelineStorage, self).post_process(paths, dry_run, **options)
class PipelineCachedStorage(CachedFilesMixin, PipelineStorage):
pass
class DefaultStorage(LazyObject): class DefaultStorage(LazyObject):
def _setup(self): def _setup(self):
self._wrapped = get_storage_class(settings.PIPELINE_STORAGE)() self._wrapped = get_storage_class(settings.PIPELINE_STORAGE)()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment