How to use the whitenoise.storage.CompressedManifestStaticFilesStorage function in whitenoise

To help you get started, we’ve selected a few whitenoise examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github harvard-lil / perma / perma_web / perma / storage_backends.py View on Github external
from django.conf import settings
import django.dispatch

from storages.backends.s3boto3 import S3Boto3Storage
from whitenoise.storage import CompressedManifestStaticFilesStorage

# used only for suppressing INFO logging in S3Boto3Storage
import logging


file_saved = django.dispatch.Signal(providing_args=["instance", "path", "overwrite"])


### Static files config

class StaticStorage(CompressedManifestStaticFilesStorage):
    pass


### Media files config

class BaseMediaStorage(object):
    """
        This mixin provides some helper functions for working with files
        in both local disk and remote storage.
    """
    def store_file(self, file_object, file_path, overwrite=False, send_signal=True):
        """
            Given an open file_object ready for reading,
            and the file_path to store it to,
            save the file and return the new file name.
github pebble / cloudpebble / cloudpebble / storage.py View on Github external
from pipeline.storage import PipelineMixin, PipelineStorage
from whitenoise.storage import CompressedManifestStaticFilesStorage, HelpfulExceptionMixin, CompressedStaticFilesMixin

class CompressedManifestPipelineStorage(PipelineMixin, CompressedManifestStaticFilesStorage):
    pass

class CompressedPipelineStorage(HelpfulExceptionMixin, CompressedStaticFilesMixin, PipelineStorage):
    pass
github evansd / whitenoise / whitenoise / storage.py View on Github external
def post_process(self, *args, **kwargs):
        files = super(CompressedManifestStaticFilesStorage, self).post_process(
            *args, **kwargs
        )
        if not kwargs.get("dry_run"):
            files = self.post_process_with_compression(files)
        return files
github isl-x / mo-django / {{cookiecutter.repo_name}} / {{cookiecutter.package_name}} / storage.py View on Github external
from django.contrib.staticfiles import finders
from django.conf import settings

from whitenoise.storage import CompressedManifestStaticFilesStorage

class DebugErroringCompressedManifestStaticFilesStorage(CompressedManifestStaticFilesStorage):

    def url(self, name, force=False):
        if settings.DEBUG:
            if finders.find(name) is None:
                raise ValueError("The file '%s' could not be found with %r." % (name, self))
        return super(DebugErroringCompressedManifestStaticFilesStorage, self).url(name)
github mozilla / standup / standup / status / storage.py View on Github external
from pipeline.storage import PipelineMixin
from whitenoise.storage import CompressedManifestStaticFilesStorage


class StandupStorage(PipelineMixin, CompressedManifestStaticFilesStorage):
    pass