TransWikia.com

'Request' object has no attribute 'accepted_renderer' - django rest frame work

Stack Overflow Asked by Kanna on December 30, 2021

‘Request’ object has no attribute ‘accepted_renderer’
Request Method: PUT
Request URL: http://127.0.0.1:8000/api/v1/masters/sku-image/create
Django Version: 2.2
Exception Type: AttributeError
Exception Value:
‘Request’ object has no attribute ‘accepted_renderer’

I am getting above error when I hit saving image

API VIEW:

class CreateSKUImageAPI(LoggingMixin, generics.CreateAPIView):
    """ Create SKU Image"""
    queryset = master_models.SKUImage.objects.all()
    serializer_class = master_serializers.SKUImageSerializer

Serializer:

class SKUImageSerializer(serializers.ModelSerializer):
    image = serializers.ImageField(write_only=True)
    image_url = serializers.CharField(source="image.url", read_only=True)
    class Meta(object):
        model = master_models.SKUImage
        fields = ('sku', 'image', 'image_url', 'id')

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP