Use S3 as static and media storage
TODO - [ ] Write some documentation for non-AWS, S3-compatible services - [ ] Make a management command to move existing media to the new S3 bucket - [ ] See if Nginx can reverse-proxy the S3 bucket in order to keep the files accessible through the domain name
This commit is contained in:
11
bookwyrm/storage_backends.py
Normal file
11
bookwyrm/storage_backends.py
Normal file
@ -0,0 +1,11 @@
|
||||
from storages.backends.s3boto3 import S3Boto3Storage
|
||||
|
||||
class StaticStorage(S3Boto3Storage):
|
||||
location = 'static'
|
||||
default_acl = 'public-read'
|
||||
|
||||
|
||||
class ImagesStorage(S3Boto3Storage):
|
||||
location = 'images'
|
||||
default_acl = 'public-read'
|
||||
file_overwrite = False
|
Reference in New Issue
Block a user