Django Oscar与AWS S3正确保存图像
我正在使用Django Oscar与AWS S3正确保存图像,django,amazon-s3,django-storage,django-oscar,Django,Amazon S3,Django Storage,Django Oscar,我正在使用django-oscar和storagesS3BotoStorage库中的S3存储。我的静态文件存储在我的s3存储桶中: STATIC_URL = "https://s3.amazonaws.com/<my_bucket_name>/static/" 当我运行python manage.py oscar\u import\u catalog\u images时,这些图像会保存到我的S3存储桶中,但是,它们会放在: <bucket_name>/images/pr
django-oscar
和storages
S3BotoStorage
库中的S3存储。我的静态文件存储在我的s3存储桶中:
STATIC_URL = "https://s3.amazonaws.com/<my_bucket_name>/static/"
当我运行python manage.py oscar\u import\u catalog\u images
时,这些图像会保存到我的S3存储桶中,但是,它们会放在:
<bucket_name>/images/products/2016/02/<image_file>
/images/products/2016/02/
虽然它们保存在此处,但在我的网站上无法正确呈现
图像呈现为空的
,大的空白被引号包围
如何正确渲染图像,并让sorl
从S3图像正确生成缩略图
根据我的初步研究,我必须以某种方式编辑类以更改目录。但我不确定这是否有助于它们的呈现方式。以前有人遇到过这个问题吗?问题是我使用的Python图像库版本不支持我的图像格式。在我卸载了pip后,我添加了必要的支持库,然后重新安装了PIL。这就解决了问题
<bucket_name>/images/products/2016/02/<image_file>