3

django-admin.py runserver is running while developing. I have an open webpage connected to my sse endpoint.

Seems like using django-sse breaks to server autoreload feature, cf. this issue.

What's worse is that if I manually restart the server (Ctr+C & django-admin.py runserver), it fails with a 'port already in use error' and I need to ps grep runserver kill whatever_id first, a true PITA.

So:

  • How comes using persistent connections breaks my dev workflow ?
  • Is there an easy workaround not involving patching django ?

In production I'm using a Procfile with foreman to launch gunicorn gevent workers. Here a manual restart goes fine (open connections are closed) but there's not autoreload feature nor any log printed in the terminal.

Maxime R.
  • 9,621
  • 7
  • 53
  • 59

0 Answers0