Skip to content

Commit

Permalink
Merge pull request #4 from ccnmtl/boto3
Browse files Browse the repository at this point in the history
Update to boto3
  • Loading branch information
sdreher committed Jun 19, 2019
2 parents 87a1802 + 1fc9756 commit 582462e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
4 changes: 4 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
0.2.0 (2019-06-19)
==================

* Update to boto3
8 changes: 4 additions & 4 deletions cacheds3storage/__init__.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
from django.core.files.storage import get_storage_class
from storages.backends.s3boto import S3BotoStorage
from storages.backends.s3boto3 import S3Boto3Storage
from django.conf import settings
from dateutil import tz


class CachedS3BotoStorage(S3BotoStorage):
class CachedS3BotoStorage(S3Boto3Storage):
def __init__(self, *args, **kwargs):
super(CachedS3BotoStorage, self).__init__(*args, **kwargs)
self.local_storage = get_storage_class(
Expand All @@ -16,7 +16,7 @@ def save(self, name, content):
return name

def modified_time(self, prefixed_path):
# S3BotoStorage returns a UTC timestamp (which it gets from S3)
# S3Boto3Storage returns a UTC timestamp (which it gets from S3)
# but an offset-naive one.
# collectstatic needs to compare that timestamp against
# a local timestamp (but again an offset-naive one)
Expand All @@ -40,4 +40,4 @@ def modified_time(self, prefixed_path):


CompressorS3BotoStorage = lambda: CachedS3BotoStorage(location='media')
MediaRootS3BotoStorage = lambda: S3BotoStorage(location='uploads')
MediaRootS3BotoStorage = lambda: S3Boto3Storage(location='uploads')
6 changes: 4 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@

setup(
name="django-cacheds3storage",
version="0.1.2",
version="0.2.0",
author="Anders Pearson",
author_email="ccnmtl-dev@columbia.edu",
author_email="ctl-dev@columbia.edu",
url="https://github.com/ccnmtl/django-cacheds3storage",
description="S3 cached storage",
long_description="s3 cached storage",
install_requires=[
"django-storages",
"python-dateutil",
"boto3",
],
scripts=[],
license="BSD",
Expand Down

0 comments on commit 582462e

Please sign in to comment.