Django Rest Framework ImageField

后端 未结 5 1806
旧巷少年郎
旧巷少年郎 2020-12-07 18:54

I can not save the image in this ImageField.

when sending data back:

{
    \"image\": [\"No file was submitted. Check the encoding t         


        
5条回答
  •  庸人自扰
    2020-12-07 19:28

    I think you can use request.data instead after django rest framework 3.0. The usage of request.DATA and request.FILES is now pending deprecation in favor of a single request.data attribute that contains all the parsed data.

    You can check it from here

提交回复
热议问题