Does Django Debug Toolbar work with DRF?

planetp picture planetp · Apr 16, 2018 · Viewed 7.6k times · Source

I'm trying to setup Debug Toolbar to debug some API methods via DRF's Browsable API. I've went through the steps described on the Installation page (like updating INSTALLED_APPS, MIDDLEWARE, etc.) but still can't see any toolbar. So does Debug Toolbar work with DRF? How to debug the issue with it not showing up?

Answer

Bojan Bogdanovic picture Bojan Bogdanovic · Feb 5, 2020

Didn't work for me until I've added

DEBUG_TOOLBAR_CONFIG = {
    "SHOW_TOOLBAR_CALLBACK": lambda request: True,
}