Why does the Django development server hang in this admin JS file?

Periodically, when using the Django administration tool, it freezes and stops responding until it is restarted. Whenever it freezes, the last line in the log is:

"GET / admin / jsi18n / http / 1.1" 200 2158

It seems that the hang occurs after POST (for example, when viewing the results of adding an object). This happens with many different models and, as far as I can tell, is unpredictable. The only constant is a GET request to this Javascript file. In addition, the time between freezes varies: sometimes you can add objects using the admin tool for an hour, sometimes it can not last 5 minutes.

In terms of performance, the box does not seem to be under a lot of voltage (average load value 0.17-0.20)

[EDIT] Recently, he throws an error that looks interesting, although it recovered itself and continued to respond after that:

[18/Aug/2011 13:19:50] "GET /admin/jsi18n/ HTTP/1.1" 200 2158 Traceback (most recent call last): File "/usr/local/lib/python2.6/dist-packages/django/core/servers/basehttp.py", line 284, in run self.finish_response() File "/usr/local/lib/python2.6/dist-packages/django/core/servers/basehttp.py", line 324, in finish_response self.write(data) File "/usr/local/lib/python2.6/dist-packages/django/core/servers/basehttp.py", line 420, in write self._write(data) File "/usr/lib/python2.6/socket.py", line 300, in write self.flush() File "/usr/lib/python2.6/socket.py", line 286, in flush self._sock.sendall(buffer) error: [Errno 32] Broken pipe 
+6
source share
1 answer

This is most likely due to the fact that you are using Google Chrome. Which will make more than one connection to the web server, which in the case of the Django Dev server will not be useful. You have two options. Or use

  • Django Parallel Server
  • Configure your dev server using a production server (not recommended, harder)
  • Use Firefox, tell Chrome to terminate multiple connections.
  • Use a separate server to host your static files on your computer. Like Lighttpd or something like that.
+1
source

Source: https://habr.com/ru/post/895357/


All Articles