class StaticS3BotoStorage(S3BotoStorage): custom_domain = setting('AWS_S3_STATIC_CUSTOM_DOMAIN') bucket_name = setting('AWS_STATIC_STORAGE_BUCKET_NAME') def __init__(self, *args, **kwargs): super(StaticS3BotoStorage, self).__init__(*args, **kwargs) self.local_storage = CompressorFileStorage() def save(self, name, content): name = super(StaticS3BotoStorage, self).save(name, content) self.local_storage._save(name, content) return name
class S3CompressedFileStorage(S3StaticFileStorage): '''Storage class that makes a local copy of the files for django_compressor.''' def __init__(self, *args, **kwargs): from compressor.storage import CompressorFileStorage super(S3CompressedFileStorage, self).__init__(*args, **kwargs) self._local_storage = CompressorFileStorage() def save(self, name, content): name = super(S3CompressedFileStorage, self).save(name, content) self._local_storage._save(name, content) return name
def __init__(self, *args, **kwargs): super(StaticS3BotoStorage, self).__init__(*args, **kwargs) self.local_storage = CompressorFileStorage()
def __init__(self, *args, **kwargs): from compressor.storage import CompressorFileStorage super(S3CompressedFileStorage, self).__init__(*args, **kwargs) self._local_storage = CompressorFileStorage()