Add S3 Storage...

This commit is contained in:
2026-04-28 21:19:32 +02:00
parent d8f6838f0c
commit 84d8a0e3b6
7 changed files with 86 additions and 4 deletions
+23
View File
@@ -0,0 +1,23 @@
from __future__ import annotations
from storages.backends.s3 import S3ManifestStaticStorage, S3Storage
class StaticStorage(S3ManifestStaticStorage):
location = 'static'
default_acl = 'public-read'
querystring_auth = False
file_overwrite = True
object_parameters = {
'CacheControl': 'public, max-age=31536000, immutable',
}
class MediaStorage(S3Storage):
location = 'media'
default_acl = 'public-read'
querystring_auth = False
file_overwrite = False
object_parameters = {
'CacheControl': 'public, max-age=604800',
}