3
맞춤 백엔드를 사용하지 않고 S3에 파일을 업로드하려고합니다.S3에 메모리에 장고 파일을 업로드하는 방법
conn=boto.connect_s3(settings.AWS_KEY, settings.AWS_SECRET)
bucket=conn.get_bucket(settings.AWS_BUCKET)
k = Key(bucket)
filename = f.name
keyname = str(int(uuid.uuid4()))[:10] + filename
k.key = keyname
k.set_contents_from_filename(f)
url = "https://s3.amazonaws.com/.../" + keyname
그리고 다음과 같은 오류 얻을 :
TypeError at /qc/86/
coercing to Unicode: need string or buffer, InMemoryUploadedFile found
가 어떻게 올바르게 정의 스토리지 백엔드를 사용하지 않고 S3에 request['FILES']
에서 파일을 업로드하는 것을 이것은 내가 지금까지 가지고 무엇인가? 이 또한 내 문제이고, https://github.com/buddylindsey/developerrage/blob/master/developerrage/comic/views.py
그레이트 : – David542
기꺼이 도와 드릴 수있었습니다. – percent20
하는 방법 boto3입니까? –