Serving Django's static and media files from S3

夙愿已清 提交于 2019-12-05 06:54:43

Answer to your second question: you need to set MEDIA_URL = https://project-staging.s3.amazonaws.com/media/ just like you're doing for STATIC_URL

For your first question, I think you need to do:

AWS_QUERYSTRING_AUTH = False

Adding the answers:

First problem: Make sure your bucket is set to public and set AWS_QUERYSTRING_AUTH in your settings to False, that way your file will be served without the signature part

AWS_QUERYSTRING_AUTH = False

Second problem: Make sure you add "url" at the end {{..url}}

{{MEDIA_URL}}{{object.flyer.url}}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!