Home > Net >  Django DRF - API shows json format instead of interface
Django DRF - API shows json format instead of interface

Time:12-27

I recently updated to Django 4.0 and DRF 3.13.1, and now my API shows in json format by default, whereas before it was showing the interface.

I would like to see an interface like so:

enter image description here

But this is what I now get.

enter image description here

Is there a way to change this back to the interface? Sorry if this is a silly question.

CodePudding user response:

In settings.py:

REST_FRAMEWORK = {
    'DEFAULT_RENDERER_CLASSES': (
        'rest_framework.renderers.BrowsableAPIRenderer', # add this first.
        'rest_framework.renderers.JSONRenderer',
    ),
    ...
  • Related