使用boto将Django静态文件上传到S3(法兰克福)

时间:2021-10-27 23:07:03

I've added os.environ['S3_USE_SIGV4'] = 'True' to my boto config, because the S3's Frankfurt region only supports this type. Currently I receive the following error: boto.s3.connection.HostRequiredError: BotoClientError: When using SigV4, you must specify a 'host' parameter.

我已将os.environ ['S3_USE_SIGV4'] ='True'添加到我的boto配置中,因为S3的Frankfurt区域仅支持此类型。目前我收到以下错误:boto.s3.connection.HostRequiredError:BotoClientError:使用SigV4时,必须指定'host'参数。

Do anybody have any idea how to set the host parameter?

有人知道如何设置主机参数吗?

1 个解决方案

#1


0  

put this in your config/settings file:

把它放在你的配置/设置文件中:

AWS_S3_HOST = 's3.eu-central-1.amazonaws.com'

Here 'eu-central-1' specifies Franfurt region. For regions other than Franfurt, refer the link http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html

这里'eu-central-1'指定弗兰福特地区。对于Franfurt以外的地区,请参阅链接http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html

#1


0  

put this in your config/settings file:

把它放在你的配置/设置文件中:

AWS_S3_HOST = 's3.eu-central-1.amazonaws.com'

Here 'eu-central-1' specifies Franfurt region. For regions other than Franfurt, refer the link http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html

这里'eu-central-1'指定弗兰福特地区。对于Franfurt以外的地区,请参阅链接http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-regions-availability-zones.html