diff options
author | prathamesh | 2021-03-24 11:47:06 +0530 |
---|---|---|
committer | prathamesh | 2021-03-24 11:47:06 +0530 |
commit | a43a152bc36717fd85493d91e6fa5d67c3ce4e5d (patch) | |
tree | 4b780fe2db408e0a900d077393e86ad6d0f60a0e /yaksh/storage_backends.py | |
parent | fc070aeab4322cfe34f6074ae1fc07db42be0fe6 (diff) | |
parent | f44cbc461f4c23c08d655749ccb525d99f2e7dbc (diff) | |
download | online_test-a43a152bc36717fd85493d91e6fa5d67c3ce4e5d.tar.gz online_test-a43a152bc36717fd85493d91e6fa5d67c3ce4e5d.tar.bz2 online_test-a43a152bc36717fd85493d91e6fa5d67c3ce4e5d.zip |
Merge branch 'master' of https://github.com/FOSSEE/online_test into add-test-cases-for-QRcode-based-upload
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..206e456 --- /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): + if settings.USE_AWS: + location = settings.AWS_STATIC_LOCATION + else: + pass + + +class PublicMediaStorage(S3Boto3Storage): + if settings.USE_AWS: + location = settings.AWS_PUBLIC_MEDIA_LOCATION + file_overwrite = True + default_acl = 'public-read' + else: + pass |