ContentFile to string
print(name)
Raw content
print(type(name))
<class 'django.core.files.base.ContentFile'>
print(name.name)
ea59c949-5e4c-495d-a58d-93f5a0d31881.jpg
print(type(name.name))
<class 'str'>
base64 type url 을 변수에 담아 print 했을 때 Raw content 라고 찍혀서 내용이 변한 줄 알았다.
그래서 ContentFile Class 를 override 해 Raw content 로 return 하는 부분을 주석 처리했다.
알고보니 Raw content 라고 찍혀도 내용은 변하지 않는다.
공식 문서를 참고해서 string type 으로 변환했다.
Author And Source
이 문제에 관하여(ContentFile to string), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://velog.io/@lyh/ContentFile-to-string저자 귀속: 원작자 정보가 원작자 URL에 포함되어 있으며 저작권은 원작자 소유입니다.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)