Python/Django

[Django] string 혹은 bytes 를 content file로 managing 해주자

insub4067 2021. 12. 18. 14:31

https://docs.djangoproject.com/en/4.0/ref/files/file/

 

The File object | Django documentation | Django

Django The web framework for perfectionists with deadlines. Overview Download Documentation News Community Code Issues About ♥ Donate

docs.djangoproject.com

ContentFile의 source code
Bytes를 가지고 ConentFile을 이용해서 ImagField를 저장하는 코드
ImageField.save()의 arguments는 name, content, save=True이다
admin panel에서 본 file 성공!