[Django]-Broken Pipe in Django dev server – What does this actually mean?

4👍

By “pipe” it means the TCP connection between the server and the browser. By “broken” it means closed.

You’ll see broken pipes when somebody closes their browser window, hits stop, or sometimes just from timing out because something else breaks the connection.

The confusing thing is that the python process likely won’t notice that the connection is closed until it tries to write to it, which could be well after the connection closes.

👤Leopd

2👍

I get this error when a browser closes a connection (it can time out, or can be manually closed). Normally it happens when I send too many connections to runserver at once (i.e. I’m serving static media, and loading a heavy page for the first time).

Django’s runserver should not be used in production, and it doesn’t handle concurrent connections with any grace. If this happens a lot, you can consider using something like django_cpserver or gunicorn in development, but you don’t get as much debug information out of them in the console.

Leave a comment