django-commons / django-debug-toolbar

A configurable set of panels that display various debug information about the current request/response.
https://django-debug-toolbar.readthedocs.io
BSD 3-Clause "New" or "Revised" License
8.08k stars 1.05k forks source link

1847 improve handling when djdt views dont respond with json #1877

Closed elineda closed 8 months ago

elineda commented 8 months ago

Description

Put a better error message when the response of the toolbar request is not a proper json object.

For test it, add after line 48 of debug_toolbar/middleware.py

from django.shortcuts import redirect
return redirect('admin:login')

Fixes #1847

Checklist: