Discussion:
'Request' object has no attribute 'accepted_renderer'
Ola
2018-08-28 13:35:28 UTC
Permalink
Hello

I am facing error 'Request' object has no attribute 'accepted_renderer' when
I am trying to customize renderer_classes in GenericViewSet. Ideally if
that would be


class CustomJSONRenderer(renderers.JSONRenderer):
media_type = 'application/ld+json'
format = 'ldjson'

class MyViewSet(mixins.RetrieveModelMixin,
mixins.ListModelMixin,
viewsets.GenericViewSet):

renderer_classes =
list(settings.REST_FRAMEWORK['DEFAULT_RENDERER_CLASSES']) +
['myapp.renderers.CustomJSONRenderer',]


Do you know by any chance what may be wrong?
All works fine if I add custom render to settings

Thanks
Ola
--
You received this message because you are subscribed to the Google Groups "Django REST framework" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-rest-framework+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...