当使用 django-storage s3 提供媒体时,正在生成的媒体 url 是这样的:
https://mybucket.s3.amazonaws.com/myimage.jpg?Signature=5ifoyLqzmtfVNS1ovfzVvN92RH0%3D&Expires=1363124819&AWSAccessKeyId=AKIAJ7ZTU7K4SPYKGOFA
由于https导致图像不显示:
You attempted to reach mybucket.s3.amazonaws.com,
but instead you actually reached a server identifying itself as *.s3.amazonaws.com.
This may be caused by a misconfiguration on the server or by something more serious. An attacker on your network could be trying to get you to visit a fake (and potentially harmful) version of mybucket.s3.amazonaws.com.
我需要将图像作为 HTTP 而不是 HTTPS
我的设置是:
DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
AWS_ACCESS_KEY_ID = "AKIAJ....K4SPYKGOFA"
AWS_SECRET_ACCESS_KEY = "2Y7G98JoCRzAEp....rPoCjWZuwDaQ"
AWS_STORAGE_BUCKET_NAME = "mybucket"
我尝试将 media_url 和 s3_url 设置为正常的 http,但它没有改变任何东西。
我正在使用 django 1.5