Django Rest Framework includes a UI for interacting with your API. Here’s how to turn it off.

This is a screenshot of the UI from the docs.

It’s pretty cool! But, I don’t want it in production. Add this to your settings file to force JSON rendering in non-debug mode– Django-speak for production.

# settings.py
if not DEBUG:
    REST_FRAMEWORK["DEFAULT_RENDERER_CLASSES"] = [
        "rest_framework.renderers.JSONRenderer",
    ]

This will render a JSON object instead of the UI.