[Fixed]-Werkzeug server is shutting down in Django application

23👍

Literally just ran into this today. According to their (git repo issue 1715) and assuming you are running runserver_plus, there are three options that worked for some users. The first worked for me:

  1. Not altering your files and adding the option --keep-meta-shutdown. My full command looks like python manage.py runserver_plus --cert-file /path/to/cert.pem --key-file /path/to/key.pem --keep-meta-shutdown localhost:9000
  2. Comment out open lines 325 and 326 under your runserver_plus.py
  3. Upgrading python to 3.10

Hope this helps!

3👍

The Django-extensions issue for this recommends running runserver_plus with the --keep-meta-shutdown argument.

Alternatively, you can just downgrade Werkzeug to 2.0.* until this is fixed:

pip install Werkzeug==2.0.*

If using a requirements.txt file, use the following:

Werkzeug==2.0.*
👤Zags

Leave a comment