Error in uploading image from a form into django model using django rest framework #8961
Replies: 2 comments
-
class entry(models.Model): set to this and try it if run good then share setting file here. |
Beta Was this translation helpful? Give feedback.
-
most probably you didn't override the post method of the viewset properly here |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I am building a website using Django,React and DRF. I want to create a form that enters data into a model containing image field. I have followed many tutorials to make this but I have failed to upload image into the Image field
models.py:
serializers.py:
views.py:
urls.py:
in Form.js:
I have tried to use fetch instead of axios like this:
No data is submitted to the database. I have tried to change debug in settings.py to false but It hasn't worked so how can I upload the image from react to Imagefield
Beta Was this translation helpful? Give feedback.
All reactions