我有這樣的錯誤,我不知道原因:Django的 - [錯誤32]破管
此錯誤是在我的控制檯:
[05/Jul/2015 15:42:35] "POST /suppression-demande HTTP/1.1" 200 4262
Traceback (most recent call last):
File "/usr/lib/python2.7/wsgiref/handlers.py", line 86, in run
self.finish_response()
File "/usr/lib/python2.7/wsgiref/handlers.py", line 128, in finish_response
self.write(data)
File "/usr/lib/python2.7/wsgiref/handlers.py", line 212, in write
self.send_headers()
File "/usr/lib/python2.7/wsgiref/handlers.py", line 270, in send_headers
self.send_preamble()
File "/usr/lib/python2.7/wsgiref/handlers.py", line 194, in send_preamble
'Date: %s\r\n' % format_date_time(time.time())
File "/usr/lib/python2.7/socket.py", line 324, in write
self.flush()
File "/usr/lib/python2.7/socket.py", line 303, in flush
self._sock.sendall(view[write_offset:write_offset+buffer_size])
error: [Errno 32] Broken pipe
[05/Jul/2015 15:42:35] "POST /suppression-demande HTTP/1.1" 500 59
在點擊一個按鈕,這個JS方法被稱爲:
function goto_confirm(username){
adress = "/suppression-demande"
if(confirm("Are you sure ?")){
$.ajax({
type:"POST",
url:adress,
data: {
'confirmation_suppression': true,
},
success: function(data){
alert("data : "+data);
}
});
window.location.href = "/home";
}
return false;
}
的網址: URL(R '^抑壓demande $', 'supprimer_demande',名字= 「supprimer_demande」),
我查看被JS方法叫:
def supprimer_demande(request):
confirmation = request.POST.get("confirmation_suppression")
return render(request,"website/lsdme.html")
嘗試在URL後添加斜線。 – Othman
我有同樣的錯誤 – YassVegas