Note that there are some explanatory texts on larger screens.

plurals
  1. POWebSocket generates error in django common middleware
    text
    copied!<p>I'm using Django + gevent-socketio + Haproxy. All socket functions works fine, but in background it generates the error shown like below. Seems like Haproxy's header for socket has very limited attributes which does not contain 'status_code' so it is failing and sends error message. Any clue that i can add status_code to it? maybe a solution is in Haproxy configuration. Thanks!</p> <p>Im using Gunicorn server as backend</p> <pre><code>Traceback (most recent call last): File "/home/young/.virtualenvs/test_project/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 188, in get_response response = middleware_method(request, response) File "/home/young/.virtualenvs/test_project/local/lib/python2.7/site-packages/django/middleware/common.py", line 94, in process_response if response.status_code == 404: AttributeError: 'dict' object has no attribute 'status_code' &lt;WSGIRequest path:/socket.io/1/xhr-polling/313746855815, GET:&lt;QueryDict: {u't': [u'1358323855701']}&gt;, POST:&lt;QueryDict: {}&gt;, COOKIES:{'csrftoken': 'K7YePbx5UF5yE7sDpX98bU4fyKChooZC', 'sessionid': 'f9806590317a86d5300a67d195a34139'}, META:{'CSRF_COOKIE': 'K7YePbx5UF5yE7sDpX98bU4fyKChooZC', 'GATEWAY_INTERFACE': 'CGI/1.1', 'HTTP_ACCEPT_CHARSET': 'utf-8, iso-8859-1, utf-16, *;q=0.7', 'HTTP_ACCEPT_ENCODING': 'gzip,deflate', 'HTTP_ACCEPT_LANGUAGE': 'en-US', 'HTTP_COOKIE': 'sessionid=f9806590317a86d5300a67d195a34139; csrftoken=K7YePbx5UF5yE7sDpX98bU4fyKChooZC', 'HTTP_HOST': '192.168.1.13', 'HTTP_REFERER': 'https://192.168.1.13/dashboard/', 'HTTP_USER_AGENT': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.34 Safari/534.24', 'HTTP_X_NETWORK_TYPE': 'WIFI', 'PATH_INFO': u'/socket.io/1/xhr-polling/313746855815', 'QUERY_STRING': 't=1358323855701', 'REMOTE_ADDR': '127.0.0.1', 'REQUEST_METHOD': 'GET', 'SCRIPT_NAME': u'', 'SERVER_NAME': 'ubuntu', 'SERVER_PORT': '8001', 'SERVER_PROTOCOL': 'HTTP/1.0', 'SERVER_SOFTWARE': 'gevent/0.13 Python/2.7', 'socketio': &lt;socketio.virtsocket.Socket object at 0x27cb950&gt;, 'wsgi.errors': &lt;open file '&lt;stderr&gt;', mode 'w' at 0x7fdc847aa270&gt;, 'wsgi.input': &lt;gevent.pywsgi.Input object at 0x27cb8d0&gt;, 'wsgi.multiprocess': True, 'wsgi.multithread': False, 'wsgi.run_once': False, 'wsgi.url_scheme': 'http', 'wsgi.version': (1, 0)}&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload