ModelViewSet and Files

When using a ModelViewSet class to receive a json, with several fields, including the “photo-profile” field, that same key arrives empty “{}”, as you can see in the photo below. Also I can’t find the file in “request.FILES”, this being empty.
Can you tell me if I will have to use another type of Django Rest Framework class or do we get the file in another way?


Side note: While there are people here who have some familiarity with DRF and will try to help you, this is not one of the officially-recognized DRF support channels. See Home - Django REST framework for the recommend support choices for DRF. You may get faster answers through one of those options.

1 Like

Hi,

DRF has various parsers, when using media files you need to use a different from the default one (JSONPARSER) and you also need to change you frontend apps, so you must use “normal” forms.

1 Like