Hi, 
Have a look herer - 
https://www.techiediaries.com/django-rest-image-file-upload-tutorial/
and
https://stackoverflow.com/questions/20473572/django-rest-framework-file-upload

Cheers


On Friday, 28 February 2020 17:05:28 UTC+5:30, Soumen Khatua wrote:
>
> Hi Folks,
>
> I'm using DRF APIView to upload images, but I don't know how to write a 
> POST request to accept image. Please advise me how I can do it?
>
> my *serializers.py*
>
>
>
>
>
>
>
>
> *class ImageSerializer(serializers.ModelSerializer):    class Meta:        
> model = Profile        fields = ['user','profile_pic']        extra_kwargs 
> = {            'user': {'write_only': True}        }*
>
> My models.py contain profile_pic as a ImageField.
>
>
> Thank you in advance
>
>
> Regards,
> soumen
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/bde0c9db-ad47-4808-ab20-4d0b06d16a37%40googlegroups.com.

Reply via email to