Coverage for app\storages.py: 76%

21 statements  

« prev     ^ index     » next       coverage.py v7.8.2, created at 2025-06-07 22:09 +0200

1from storages.backends.s3boto3 import S3Boto3Storage 

2 

3 

4class PublicMediaStorage(S3Boto3Storage): 

5 location = "public" 

6 default_acl = "public-read" 

7 file_overwrite = False 

8 

9 

10class PrivateMediaStorage(S3Boto3Storage): 

11 location = "private" 

12 default_acl = "private" 

13 file_overwrite = False 

14 custom_domain = False 

15 

16 

17class PublicS3Boto3Storage(S3Boto3Storage): 

18 """ 

19 Storage Bucket for public data (static files) 

20 """ 

21 

22 bucket_acl = "download" 

23 default_acl = "download" 

24 bucket_name = "public" 

25 auto_create_bucket = True 

26 

27 def __init__(self, acl=None, bucket=None, **settings): 

28 if acl is not None: 

29 self.bucket_acl = acl 

30 if bucket is not None: 

31 self.bucket_name = bucket 

32 super().__init__(**settings)