Django Debug Toolbar prevents logging/tracebacks appearing in runserver
See original GitHub issueLet’s say I start Django channels server with command:
python3 manage.py runserver 0.0.0.0:8001
There is no any customisation in settings.py regarding Logging except
DEBUG = True
And all what I can see in logging are 4 types of messages:
WebSocket HANDSHAKING, WebSocket CONNECT, WebSocket DISCONNECT and WebSocket REJECT
Even if I set assert False right before self.connect(), the only logs I get:
WebSocket HANDSHAKING /core/ [192.168.122.4:52494]
WebSocket DISCONNECT /core/ [192.168.122.4:52494]
Yes, just 2 lines. Nothing about assertion error or anything else.
This is how it suppose to be? How can I see the same logging that shows errors as it was on WSGI?
I’m using latest channels package, taken from github. There are some “fixes” in runserver.py file, but still the same. No normal logging, just messages about websocket sessions state.
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
unable to run server when django debug toolbar is enabled
Finally, found the answer that we have an infinite loop of DEBUG_TOOLBAR set in our multiple settings file, so it's causing a loop...
Read more >Configuration — Django Debug Toolbar 3.8.1 documentation
Don't copy-paste blindly the default values shown below into your settings module! It's useless and it'll prevent you from taking advantage of better ......
Read more >Installation — Django Debug Toolbar 3.8.1 documentation
The Debug Toolbar is shown only if your IP address is listed in Django's INTERNAL_IPS setting. This means that for local development, ...
Read more >Release 3.7.0 unknown - Django Debug Toolbar
The Debug Toolbar is shown only if your IP address is listed in ... On some platforms, the Django runserver command may use...
Read more >Panels — Django Debug Toolbar 3.7.0 documentation
Panels can ship their own templates, static files and views. All views should be decorated with debug_toolbar.decorators.require_show_toolbar to prevent ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Sorry to reopen this discussion with a comment. But this mades lost days of works, trying to find a proper solution, I particularly have lot of rules in my LOGGING config so disabling the logging in the develop mode was really inconvenient.
Another solution and a more clean one, is to remove the logging panel that is enable by default in django debug toolbar.
Just that fixes the issues, you keep django debug toolbar working for your http requests and have also the tracebacks in the console.
Hope is useful for others
Thanks for reminding me of that, @matthiask! I will close this.