Django storage backend to be used with S3
Project description
django-cached-s3-storage
========================
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 = 'django_cached_s3_storage.CachedS3BotoStorage'
COMPRESS_STORAGE = STATICFILES_STORAGE
AWS_ACCESS_KEY_ID = os.environ['AWS_ACCESS_KEY_ID']
AWS_SECRET_ACCESS_KEY = os.environ['GAWS_SECRET_ACCESS_KEY']
AWS_STORAGE_BUCKET_NAME = os.environ['GAWS_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 = 315360000
AWS_HEADERS = {
'x-amz-acl': 'public-read',
'Expires': http_date(time() + max_age),
'Cache-Control': 'public, max-age=' + str(max_age)
}
```
========================
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 = 'django_cached_s3_storage.CachedS3BotoStorage'
COMPRESS_STORAGE = STATICFILES_STORAGE
AWS_ACCESS_KEY_ID = os.environ['AWS_ACCESS_KEY_ID']
AWS_SECRET_ACCESS_KEY = os.environ['GAWS_SECRET_ACCESS_KEY']
AWS_STORAGE_BUCKET_NAME = os.environ['GAWS_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 = 315360000
AWS_HEADERS = {
'x-amz-acl': 'public-read',
'Expires': http_date(time() + max_age),
'Cache-Control': 'public, max-age=' + str(max_age)
}
```
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for django-cached-s3-storage-0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 03c9c2208dbcc6550605f5424513ac35d7132f6cf9bfafb42110182501219f9f |
|
MD5 | f001fded4a712a9d7f29e5efcc37b5ce |
|
BLAKE2b-256 | a2cbe24e31899e347714a0c9dc5ea2f830bd5f596d0456fec94a0a45b5cb7ff9 |
Close
Hashes for django-cached-s3-storage-0.1.macosx-10.5-intel.exe
Algorithm | Hash digest | |
---|---|---|
SHA256 | fe367c02db29cf978c9b7888496b66b97770da639f6078b949552d8596e022d3 |
|
MD5 | 6a4ed80c38025a181f293ade012e5053 |
|
BLAKE2b-256 | 4b07f4ffed922d2223a5b52c46f26dc1fb8edb1a22ede2d1fb150889bb8c37e7 |