【发布时间】:2018-01-30 21:48:14
【问题描述】:
我有一个在 Apache 和 mod_wsgi 下运行的 Flask 应用程序。 它需要从 AWS S3 读取,所以我使用 boto3。 我所做的是运行 aws configure 来创建 ~/.aws 然后将其移至 为 WSGI 配置的 home。但是当我运行应用程序时,我得到:
botocore.exceptions.ClientError: An error occurred (AccessDenied) when calling the ListBuckets operation: Access Denied
如果我将 WSGI 应用程序启动文件中的键设置为 os.environ['AWS_....'] = ... 它可以正常工作。
那么问题是如何利用在 mod_wsgi 下运行的 Flask 应用程序的 aws configure 输出?
【问题讨论】:
标签: python amazon-web-services amazon-s3 mod-wsgi boto3