使用Django的收藏品与boto S3抛出“错误32:破碎的管道”过了一会儿 [英] Using Django's collectstatic with boto S3 throws "Error 32: Broken Pipe" after a while

查看:205
本文介绍了使用Django的收藏品与boto S3抛出“错误32:破碎的管道”过了一会儿的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在S3中使用boto来存储我的Django站点的静态文件。当使用 collectstatic 命令时,它会在停止文件之前上传好的文件,并抛出Error 32:Broken Pipe。当我再次尝试运行该命令时,它将跳过已经上传的文件,并从它所在的文件开始,然后再抛出相同的错误,而不会上传任何新内容。

I'm using boto with S3 to store my Django site's static files. When using the collectstatic command, it uploads a good chunk of the files perfectly before stopping at a file and throwing "Error 32: Broken Pipe." When I try to run the command again, it skips over the files it has already uploaded and starts at the file where it left off, before throwing the same error without having uploaded anything new.

推荐答案

关键似乎是指定哪个 AWS Endpoint 您的存储区位于。我尝试这样做了一堆不同的方式,但最终为我工作的解决方案是创建一个配置文件boto,如文档所述。

The key seems to be to specify which AWS Endpoint your bucket is located in. I tried doing this a bunch of different ways, but the solution that finally worked for me was to create a config file for boto as specified in the documentation.

以下是我在〜/ .boto 中创建的配置文件的内容:

Here are the contents of the config file I created at ~/.boto:

[Credentials]
aws_access_key_id = XXXXXXXXXXXXXXXXXXXX
aws_secret_access_key = XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
[s3]
host=s3-us-west-2.amazonaws.com

这篇关于使用Django的收藏品与boto S3抛出“错误32:破碎的管道”过了一会儿的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆