Skip to content

Commit

Permalink
Remove django-compressor storage
Browse files Browse the repository at this point in the history
It looks like this was initially set up via these docs:
https://django-compressor.readthedocs.io/en/2.4.1/remote-storages/#using-staticfiles
  • Loading branch information
nikolas committed Feb 17, 2023
1 parent 0b5c03a commit 991d3d5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 11 deletions.
4 changes: 4 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
0.3.0
==================
* Remove django-compressor local_storage

0.2.2 (2020-07-16)
==================
* Update the seek of closed file fix to work with django-storages 1.9.x.
Expand Down
11 changes: 0 additions & 11 deletions cacheds3storage/__init__.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
import os
from django.core.files.storage import get_storage_class
from storages.backends.s3boto3 import S3Boto3Storage, SpooledTemporaryFile
from django.conf import settings
from dateutil import tz


class CachedS3BotoStorage(S3Boto3Storage):
def __init__(self, *args, **kwargs):
super(CachedS3BotoStorage, self).__init__(*args, **kwargs)
self.local_storage = get_storage_class(
'compressor.storage.CompressorFileStorage')()

# https://github.com/jschneier/django-storages/issues/382
# #issuecomment-592876060
def _save(self, name, content):
Expand All @@ -37,11 +31,6 @@ def _save(self, name, content):
return super(CachedS3BotoStorage, self)._save(
name, content_autoclose)

def save(self, name, content):
name = super(CachedS3BotoStorage, self).save(name, content)
self.local_storage._save(name, content)
return name

def modified_time(self, prefixed_path):
# S3Boto3Storage returns a UTC timestamp (which it gets from S3)
# but an offset-naive one.
Expand Down

0 comments on commit 991d3d5

Please sign in to comment.