Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9214d5f

Browse files
committed
Fix KeyError: 'werkzeug.server.shutdown' in runserver_plus
Exception: ``` Exception happened during processing of request from ('172.20.0.5', 34456) Traceback (most recent call last): File "/usr/lib/python3.7/socketserver.py", line 650, in process_request_thread self.finish_request(request, client_address) File "/usr/lib/python3.7/socketserver.py", line 360, in finish_request self.RequestHandlerClass(request, client_address, self) File "/usr/lib/python3.7/socketserver.py", line 720, in __init__ self.handle() File "/opt/cloudsmith/deps/venv/lib/python3.7/site-packages/werkzeug/serving.py", line 347, in handle super().handle() File "/usr/lib/python3.7/http/server.py", line 426, in handle self.handle_one_request() File "/usr/lib/python3.7/http/server.py", line 414, in handle_one_request method() File "/opt/cloudsmith/deps/venv/lib/python3.7/site-packages/werkzeug/serving.py", line 243, in run_wsgi self.environ = environ = self.make_environ() File "/opt/cloudsmith/deps/venv/lib/python3.7/site-packages/django_extensions/management/commands/runserver_plus.py", line 326, in make_environ del environ['werkzeug.server.shutdown'] KeyError: 'werkzeug.server.shutdown' ``` Fixes: django-extensions#1715, pallets/werkzeug#2387
1 parent 2df7d93 commit 9214d5f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

django_extensions/management/commands/runserver_plus.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ def inner_run(self, options):
322322
class WSGIRequestHandler(_WSGIRequestHandler):
323323
def make_environ(self):
324324
environ = super().make_environ()
325-
if not options['keep_meta_shutdown_func']:
325+
if not options['keep_meta_shutdown_func'] and 'werkzeug.server.shutdown' in environ:
326326
del environ['werkzeug.server.shutdown']
327327
return environ
328328

0 commit comments

Comments
 (0)