Skip to main content

This package contains a CachedS3BotoStorage to be used with django-compressor and S3.

Code copied from https://github.com/jezdez/django_compressor/issues/100.

Example settings:

DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
STATICFILES_STORAGE = 'cached_s3_storage.CachedS3BotoStorage'
COMPRESS_STORAGE = STATICFILES_STORAGE

AWS_ACCESS_KEY_ID = os.environ['AWS_ACCESS_KEY_ID']
AWS_SECRET_ACCESS_KEY = os.environ['AWS_SECRET_ACCESS_KEY']
AWS_STORAGE_BUCKET_NAME = os.environ['AWS_STORAGE_BUCKET_NAME']
AWS_PRELOAD_METADATA = True
AWS_IS_GZIPPED = True
AWS_QUERYSTRING_AUTH = False

from django.utils.http import http_date
from time import time
max_age = 31536000
AWS_HEADERS = {
        'x-amz-acl': 'public-read',
        'Expires': http_date(time() + max_age),
        'Cache-Control': 'public, max-age=' + str(max_age)
}

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-cached-s3-storage-0.2.1.tar.gz (1.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file django-cached-s3-storage-0.2.1.tar.gz.

File metadata

File hashes

Hashes for django-cached-s3-storage-0.2.1.tar.gz
Algorithm Hash digest
SHA256 7cb841a5975c40cbfc411b76a1b50d1a352366b72c52bf2685cde50db0cf9d23
MD5 097dab1d0e777a97c4cafbef0192635c
BLAKE2b-256 e6579beac67c4b1d49c33fa0e6684ad1fa31edb3f0e20fb9b4d580233033c81b

See more details on using hashes here.

File details

Details for the file django-cached-s3-storage-0.2.1.macosx-10.8-intel.exe.

File metadata

File hashes

Hashes for django-cached-s3-storage-0.2.1.macosx-10.8-intel.exe
Algorithm Hash digest
SHA256 6a4bca5464449dcd64a69bf828fe3a889df712da94122fb2c1c7bffdbb78f4cd
MD5 dee10be662726a4781a0ba97d9c131de
BLAKE2b-256 55e03dd5c13deef2802bc100d4181525656559d4a3945adad12e1517e6e6805f

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 files

0.2

2 files

0.1

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page