Search code examples
pythondjangowerkzeugdjango-extensions

Django extensions/werkzeug runserver_plus crashes with exit 247 when catching an error


This issue just appeared a few weeks ago and I haven't been able to track it down or fix it. I always use runserver_plus for the dev server so that I can use the werkzeug debugger. However, for some reason, now whenever there's an exception, instead of properly displaying the werkzeug debug page, runserver_plus crashes.

First, the only the HTML of the page is loaded: image

Then the server itself crashes: image

I am on Mac OS X (latest version). I have not been able to track down what that exit code 247 means--it only appears when I run it in PyCharm. The server does also crash if I run it outside of PyCharm, but without telling me the status code.


Solution

  • While I'm still not sure what exactly the nature of the problems was, I realized finally that this issue only occurred when within LOGGING within settings.py, I had the 'mail_admins' handler enabled and it included the settings 'include_html': True.

    No idea why this is the case, but once I turned off include_html, the Werkzeug debugger worked as expected.