【发布时间】:2021-11-06 01:29:18
【问题描述】:
我正在使用开发服务器来测试使用 Django 存储和 Boto3 从 AWS S3 上传和检索静态文件。文件上传成功,但我无法检索文件。
这是我得到的:
当我在另一个标签中查看 URL 时,我得到了这个
**This XML file does not appear to have any style information associated with it. The document tree is shown below.**
<Error>
<Code>IllegalLocationConstraintException</Code>
<Message>The me-south-1 location constraint is incompatible for the region specific endpoint this request was sent to.</Message>
<RequestId></RequestId>
<HostId></HostId>
</Error>
我还使用自己的凭据和 IAM 用户配置了 settings.py
AWS_ACCESS_KEY_ID = <key>
AWS_SECRET_ACCESS_KEY = <secret-key>
AWS_STORAGE_BUCKET_NAME = <bucket-name>
AWS_DEFAULT_ACL = None
AWS_S3_FILE_OVERWRITE = False
AWS_S3_REGION_NAME = 'me-south-1'
AWS_S3_USE_SSL = True
AWS_S3_VERIFY = False
DEFAULT_FILE_STORAGE = 'storages.backends.s3boto3.S3Boto3Storage'
【问题讨论】:
-
你的存储桶区域是什么,因为消息清楚地指向了错误的区域
-
他们都是我检查过很多次的同一个地区
标签: django amazon-s3 boto3 django-storage python-django-storages