2014-01-28 32 views
2

我目前正在嘗試將我學校的LDAP與使用Django構建的網站一起使用。但是我遇到了一個我無法解決的錯誤。破管errno32 LDAP Django

當我使用我學校的網絡時,LDAP登錄功能在localhost上完美工作。但是,當我使用校外網絡時,登錄無效,即使第一次運行manage.py時創建的管理員登錄名也不起作用。

終端顯示器的每一次我嘗試登錄以下錯誤:

Traceback (most recent call last): 
    File "/Users/Me/anaconda/lib/python2.7/wsgiref/handlers.py", line 86, in run 
    self.finish_response() 
    File "/Users/Me/anaconda/lib/python2.7/wsgiref/handlers.py", line 128, in finish_response 
    self.write(data) 
    File "/Users/Me/anaconda/lib/python2.7/wsgiref/handlers.py", line 212, in write 
    self.send_headers() 
    File "/Users/Me/anaconda/lib/python2.7/wsgiref/handlers.py", line 270, in send_headers 
    self.send_preamble() 
    File "/Users/Me/anaconda/lib/python2.7/wsgiref/handlers.py", line 194, in send_preamble 
    'Date: %s\r\n' % format_date_time(time.time()) 
    File "/Users/Me/anaconda/lib/python2.7/socket.py", line 324, in write 
    self.flush() 
    File "/Users/Me/anaconda/lib/python2.7/socket.py", line 303, in flush 
    self._sock.sendall(view[write_offset:write_offset+buffer_size]) 
error: [Errno 32] Broken pipe 
[28/Jan/2014 11:18:43] "POST /admin/ HTTP/1.1" 500 59 
---------------------------------------- 
Exception happened during processing of request from ('127.0.0.1', 60538) 
Traceback (most recent call last): 
    File "/Users/Me/anaconda/lib/python2.7/SocketServer.py", line 593, in process_request_thread 
    self.finish_request(request, client_address) 
    File "/Users/Me/anaconda/lib/python2.7/SocketServer.py", line 334, in finish_request 
    self.RequestHandlerClass(request, client_address, self) 
    File "/Users/Me/anaconda/lib/python2.7/site-packages/django/core/servers/basehttp.py", line 150, in __init__ 
    super(WSGIRequestHandler, self).__init__(*args, **kwargs) 
    File "/Users/Me/anaconda/lib/python2.7/SocketServer.py", line 651, in __init__ 
    self.finish() 
    File "/Users/Me/anaconda/lib/python2.7/SocketServer.py", line 710, in finish 
    self.wfile.close() 
    File "/Users/Me/anaconda/lib/python2.7/socket.py", line 279, in close 
    self.flush() 
    File "/Users/Me/anaconda/lib/python2.7/socket.py", line 303, in flush 
    self._sock.sendall(view[write_offset:write_offset+buffer_size]) 
error: [Errno 32] Broken pipe 
---------------------------------------- 

非常感謝您的幫助!

回答

1

這是Django devserver的一個問題(您正在運行您的網站使用它,這對生產網站來說並不推薦)。

請參閱this ticket瞭解更多詳情:

據許多來源「破裂的管道」是一個正常的瀏覽器怪癖。例如,瀏覽器從套接字中讀取數據,然後決定它讀取的圖像顯然沒有改變。瀏覽器現在(強制)關閉連接,因爲它不需要更多的數據。這個套接字(python runserver)的另一端現在引發一個套接字異常,告訴程序客戶端'斷開套接字管道'。

簡短的回答是:忽略這個錯誤,因爲這是一個已知錯誤,不會被修復。

還有this SO thread在談論這個問題。