Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Stop werkzeug from messing my django debugging

For some https testing I needed to install Werkzeug. When accessing my site via https, Werkzeug decides that it must catch all exceptions, and takes over the role of the django-debug-toolbar and built-in django exception handling, by default, without even a configuration parameter:

Brought to you by DON'T PANIC, your friendly Werkzeug powered traceback interpreter.

Well, I am panicking right now. I want my django-debug-toolbar back, specially when doing https, since what Werkzeug shows me is by comparison not enough.

How can I tell Werkzeug to stop being intrusive, and let exceptions reach django?

like image 514
blueFast Avatar asked Dec 29 '25 20:12

blueFast


1 Answers

I'm guessing that you're using django-extensions's RunServerPlus (manage.py runserver_plus) to test HTTPS. RunServerPlus enables the Werkzeug debugger by default and looking at the source, there's no way to disable it. The same applies to django-werkzeug-debugger-runserver.

I'd recommend opening an issue with the django-extensions project and/or trying django-sslserver as an alternative.


In case I guessed incorrectly: If you're directly using Werkzeug's run_simple, call it with use_debugger=False. If you're directly using Werkzeug's DebuggedApplication middleware, well, stop using it - it's the source of your problems.

like image 159
Miikka Avatar answered Jan 01 '26 12:01

Miikka



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!