S3 Links Expire for Images
See original GitHub issueMy S3 image links are expiring after one hour. This is because you store the URL to the backend within the textbox as the location it stores the file at with the Signature/Expiration that was given as a return from S3. This signature expires after 1 hour. I can make the Signature last 7 days at max, but then we’re back to the same issue.
<img src="https://bucketname.s3.amazonaws.com/django-summernote/2020-03-04/5cb7c679-2143-434d-a6e2-5cec03225411.jpg?AWSAccessKeyId=AAAAAAAAAAAAAAAAAAAAAAA&Signature=BvNIMcOJurphnCKZaarGQDDnHc8%3D&Expires=1583302245" style="width: 25%;">
To solve this issue, couldn’t you just reference the image location from the Attachments saved to the database?
https://bucketname.s3.amazonaws.com/django-summernote/2020-03-04/5cb7c679-2143-434d-a6e2-5cec03225411.jpg?AWSAccessKeyId=AAAAAAAAAAAAAAAAAAAAAAA&Signature=VowPCxFZ9ZjMbb7WdnhoMYk46Q8%3D&Expires=1583351249
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:5
Top GitHub Comments
This is the code to resolve the issue. Been using this for a couple years.
pip install beautifulsoup4
At the top of views.py
Within your view:
I should mention that the field ‘body’ is the field with the summernote widget.
Well, there is another simple way to do this. which is recommended by documentation.
just override django storage class like this.
look at this option, it will do magic.
querystring_auth=False
and then use this class in your settings file. like this.
I hope this will be helpful.