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?
The Debug Toolbar is shown only if your IP address is listed in Django's INTERNAL_IPS setting. This means that for local development, you must add "127.0. 0.1" to INTERNAL_IPS .
One of the main features of debug mode is the display of detailed error pages. If your app raises an exception when DEBUG is True, Django will display a detailed traceback, including a lot of metadata about your environment, such as all the currently defined Django settings (from settings.py).
Didn't work for me until I've added
DEBUG_TOOLBAR_CONFIG = {
"SHOW_TOOLBAR_CALLBACK": lambda request: True,
}
Yes, it works fine if you have the correct INTERNAL_IPS = [..]
. With docker you also have to find out the IP of serving proxy-server for example nginx
-container.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With