diff options
Diffstat (limited to 'yaksh/storage_backends.py')
-rw-r--r-- | yaksh/storage_backends.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/yaksh/storage_backends.py b/yaksh/storage_backends.py new file mode 100644 index 0000000..4d08c8c --- /dev/null +++ b/yaksh/storage_backends.py @@ -0,0 +1,18 @@ +from django.conf import settings +from storages.backends.s3boto3 import S3Boto3Storage + + +class StaticStorage(S3Boto3Storage): + location = settings.AWS_STATIC_LOCATION if settings.USE_AWS else settings.STATIC_URL + + +class PublicMediaStorage(S3Boto3Storage): + location = settings.AWS_PUBLIC_MEDIA_LOCATION if settings.USE_AWS else settings.MEDIA_URL + file_overwrite = False + + +class PrivateMediaStorage(S3Boto3Storage): + location = settings.AWS_PRIVATE_MEDIA_LOCATION if settings.USE_AWS else settings.MEDIA_URL + default_acl = 'private' + file_overwrite = False + custom_domain = False
\ No newline at end of file |