Closed chan-bai closed 2 days ago
A comment on the accepted answer here
https://stackoverflow.com/questions/64193171/how-to-generate-presigned-s3-urls-using-django-storages
suggests that you need
AWS_QUERYSTRING_AUTH = True
Though I am trying that with digital ocean spaces and it isn't working for me.
Worth noting that it doesn't work wit a custom domain set. I only got it working after I removed that setting.
I have a Django application deployed in an EKS cluster as a Kubernetes pod. This pod has the right IAM attached to it using Kubernetes Service Account.
I am currently trying to store all the static files in a private S3 bucket using django-storages and boto3.
However, django-storages returns unsigned URL instead of the pre-signed URL. This results in the web pages rendering only the HTML code.
I have manually generated the pre-signed URL inside the Kubernetes pod by running
aws s3 presign s3://<URL to the S3 BUCKET>/staticfiles.json
which returned the correct pre-signed URL.These are my relevant settings
Versions: