Disable DRF Browsable API

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.

December 3, 2025

Django Routing 101

Something I’ve taken a while to get under my fingers is Django’s URL routing conventions. Here’s a brief summary. At the root of your app or apps, you’ll find a file like this. # urls.py from django.urls import path from . import views urlpatterns = [ path("articles/2003/", views.special_case_2003), path("articles/<int:year>/", views.year_archive), path("articles/<int:year>/<int:month>/", views.month_archive), ] On a bigger app, these path calls might look like this: path("api/posts/", include(posts_urls.urlpatterns)), Which are include-ing from other nested urls.py. I think this convention is a little less direct than Rails’ giant routes.rb, but it also keeps the URLs in nice buckets with the rest of their supporting code.

November 7, 2025