Inconsistent SignatureDoesNotMatch Amazon S3 with django-pipeline, s3boto and storages

前端 未结 5 1218
萌比男神i
萌比男神i 2020-12-10 09:08

I have 2 files compiled by django-pipeline along with s3boto: master.css and master.js. They are set to \"Public\" in my buckets. However, when I access them, sometimes mast

5条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-10 09:46

    I was struggling with this for a while, and I didn't like the idea of messing up with CachedFilesMixin (seemed like an overkill to me).

    Until a proper fix is issued to the django platform, I've found quoting the signature two times is a good option. I know it's not pretty, but it works and it's simple.

    So you'll just have to do something like this:

    signature = urllib.quote_plus(signature.strip())
    signature = urllib.quote_plus(signature.strip())
    

    Hope it helps!

提交回复
热议问题