Skip to content

Commit

Permalink
Feature/presigned url on medias (#408)
Browse files Browse the repository at this point in the history
* feat: add private media storage

* feat: update querystring_auth on PrivateMediaStorage to True, to be able to use pre signed url

* feat: remove PrivateMediaStorage, as it's not needed anymore

* feat: remove update on excelstorage

* feat: use env var on s3 config
  • Loading branch information
helllllllder authored Oct 21, 2024
1 parent b3b2fb6 commit b351e26
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion chats/apps/msgs/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,10 @@ class MessageMedia(BaseModel):
)
content_type = models.CharField(_("Content Type"), max_length=300)
media_file = models.FileField(
_("Media File"), null=True, blank=True, max_length=300
_("Media File"),
null=True,
blank=True,
max_length=300,
)
media_url = models.TextField(_("Media url"), null=True, blank=True)

Expand Down
4 changes: 2 additions & 2 deletions chats/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,8 +204,8 @@

AWS_STORAGE_BUCKET_NAME = env.str("AWS_STORAGE_BUCKET_NAME")

AWS_QUERYSTRING_AUTH = False
AWS_S3_FILE_OVERWRITE = False
AWS_QUERYSTRING_AUTH = env.bool("AWS_QUERYSTRING_AUTH", default=True)
AWS_S3_FILE_OVERWRITE = env.bool("AWS_S3_FILE_OVERWRITE", default=False)

else:
MEDIA_URL = "/media/"
Expand Down

0 comments on commit b351e26

Please sign in to comment.