You just need to remove the viewable API renderer from the list of supported renderings for the view.
You can do it globally, for example:
REST_FRAMEWORK = { 'DEFAULT_RENDERER_CLASSES': ( 'rest_framework.renderers.JSONRenderer', ) }
Or for each view:
class MyView(...): renderer_classes = [renderers.JSONRenderer]
Besides . In many cases, it seems to me a shame that people will in any case disable the API for viewing, as this is a big help to any developers working on the API, and that doesnβt mean t give them more permissions that they otherwise had would. I see that in some cases there may be business reasons, but overall I consider this a huge asset.
Tom Christie Oct 31 '12 at 10:56 2012-10-31 10:56
source share