Exemple #1
0
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
Exemple #2
0
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
Exemple #3
0
 def __init__(self, *args, **kwargs):
     super(StaticS3BotoStorage, self).__init__(*args, **kwargs)
     self.local_storage = CompressorFileStorage()
Exemple #4
0
 def __init__(self, *args, **kwargs):
     from compressor.storage import CompressorFileStorage
     super(S3CompressedFileStorage, self).__init__(*args, **kwargs)
     self._local_storage = CompressorFileStorage()