我正在尝试将文件更新为s3,但它失败了。
我安装了django-storages
和boto
。
这是我的代码:
DEFAULT_FILE_STORAGE = 'storages.backends.s3boto.S3BotoStorage'
AWS_ACCESS_KEY_ID = "xyxyxyx"
AWS_SECRET_ACCESS_KEY = "yxyxy+yxx+yxyx"
AWS_STORAGE_BUCKET_NAME = "mysite"
AWS_S3_SECURE_URLS = False
AWS_QUERYSTRING_AUTH = False
AWS_STORAGE_BUCKET_NAME = 'mysite.media'
和照常定义的模型:
class MyModel(models.Model):
customimage = models.ImageField(upload_to='customimg/')
我尝试从django admin上传文件,过了一会儿,错误来了:
[Errno 10054] An existing connection was forcibly closed by the remote host
我错过了什么吗?
如果取决于地区,如何在设置中设置s3区域?