mitsuhiko/werkzeug — pull request #494 by ericbuehl (2014-02-05 19:43:26+00:00)
Title: mark shutdown method with do_not_call_in_templates

Django inadvertently calls methods passed as WSGI params which causes
the server to be shut down whenever an exception is thrown and
DEBUG=True

My attempt to get this fix into Django has not gained much traction. There is currently an open ticket: https://code.djangoproject.com/ticket/21048