下面是我在我的bucket中点击“公开”的图片:
然后在弹出窗口中单击“公开”:
它说它成功地完成了-但是当我刷新页面时,它仍然给了我“公开”的选项,所以它看起来不起作用。当我进入我的网站时,图片仍然没有显示出来,进一步显示的图片仍然是不公开的。这是src
在我的网站上使用的img
:
https://postr-bucket.s3.amazonaws.com/static/images/settingsIcon.png?Expires=1519249290&Signature=9eixuWMxLknf%2BAnDB1XIS30ntO8%3D&AWSAccessKeyId=AKIAIDO3PF5Y7SMSOHHA
我不认为访问密钥应该在src
中,但我不确定如何更改它。我的AWS设置正常:
我也尝试过对整个bucket使用相同的“公开”选项,但是结果是一样的(表示成功,但没有公开)。在
知道为什么吗?在
你有没有试着用
.set_canned_acl('public-read')
通过API公开你的文件?你说得太复杂了-既然你公开了,src应该
https://postr-bucket.s3.amazonaws.com/static/images/settingsIcon.png
你可以忘记其余的参数,他们可能导致它太失败-如果你点击我给你的链接,你会看到你的图像-我知道我可以。
编辑:查看此链接:https://django-storages.readthedocs.io/en/latest/backends/amazon-S3.html
相关问题 更多 >
编程相关推荐