s3boto 백엔드와 함께 django 저장소를 사용하고 있습니다. 이 문제에 따라 http://code.larlet.fr/django-storages/issue/5/s3botostorage-set-content-type-header-acl-fixed-use-http-and-disable-query-auth-by 콘텐츠 유형이 'application/octet-stream'인 여러 파일 (모두)이 있습니다. <class 'boto.s3.key.Key'>
이라는 인스턴스가 있다고 가정하면 어떻게 content_type을 설정할 수 있습니까?boto를 사용하여 이미 s3에있는 파일에 content_type을 설정하십시오.
In [29]: a.file.file.key.content_type
Out[29]: 'application/octet-stream'
In [30]: mimetypes.guess_type(a.file.file.key.name)[0]
Out[30]: 'image/jpeg'
In [31]: type(a.file.file.key)
Out[31]: <class 'boto.s3.key.Key'>