-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add API to expose toolbar data #2048
Comments
Thank you for writing this up. I'm generally onboard with this. I'm curious if we should ask for a sample client app to consume and render this. @robhudson you mentioned a TUI interface. Is that something that could be open-sourced and be mentioned as a third-party plugin? |
I've got the start of a TUI app based on Textual that I'd be happy to release/share once it's updated to use this API. |
To ensure that the JSON web API is secure and is not accidentally exposed in production, we can consider this 3-layer approach: 1. Enable API via
|
Summary:
Enhance the Django Debug Toolbar by providing an API to expose collected debug data. This API will enable new UIs to interact with the debug information programmatically, especially useful for API-only Django projects or cases where injecting HTML interferes with the application's frontend.
Proposal:
Add two initial API endpoints, building upon the
serializable
branch, which already stores collected debug stats as JSON in pluggable storage.Get All Request IDs and Basic Info
request_id
s along with some basic metadata about each request, similar to the current history panel.GET /__debug__/api/requests/
Get Full Data for a Specific Request
request_id
.GET /__debug__/api/requests/<str:request_id>/
Motivation:
Currently, the Django Debug Toolbar injects an HTML interface into pages for debugging. However:
This API will provide greater flexibility and usability for a wider range of projects while leveraging the existing serializable storage architecture.
Implementation Details:
serializable
branch:/requests/
endpoint, if there are many requests, pagination can be implemented to improve performance and usability.The text was updated successfully, but these errors were encountered: