-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Alternative lightweight HTML injection #999
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
Comments
Sounds good. I can't promise much, but I'll certainly review/provide feedback. I'm not sure I understand whether you're proposing to add another middleware besides the current one, or if you'd want to modify the existing middleware. I suspect that the later would be less work down the road because there's only one code path to maintain. |
I suggested a new middleware to make sure that the current behaviour is left untouched, but if it makes sense to have conditions inside one same middleware, that could be done. |
FTR, I am testing https://github.com/recamshak/django-debug-panel which works with JSON responses and lets me see history. |
Hello! I mostly develop APIs in Python, trying things out with a command-line HTTP client. When things go bad, it is quite unfriendly to get a huge dump of HTML in the terminal and have to scroll up to find the error message.
In contrast, pyramid-debug-toolbar only injects a few lines in responses, with a link that you can open in your browser to see debug info, which works when testing in a browser or from any other HTTP client:
This is the code injected, which lets the whole page for a 404 or 500 error fit in my terminal:
In the abstract, is this a feature that djdt developers would accept?
For the implementation. A new middleware would be needed to inject just the link, with a new view that does the same job as the current middleware (query panels to get the toolbar info, send requests to display more info for a panel). It doesn’t seem to require many changes, and the standard mode would be unchanged.
The text was updated successfully, but these errors were encountered: