簡體   English   中英

Django-[Errno 32]管道損壞

[英]Django - [Errno 32] Broken pipe

我有這個錯誤,我不知道原因:

此錯誤在我的控制台中:

[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:url(r'^ suppression-demande $','supprimer_demande',name =“ supprimer_demande”),

js方法調用的My View:

def supprimer_demande(request):   
    confirmation = request.POST.get("confirmation_suppression")
    return render(request,"website/lsdme.html")

嘗試移除
window.location.href =“ / home”;
從您的js方法go_confirm()。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM