Django + WebKit = Broken pipe

后端 未结 6 1799
予麋鹿
予麋鹿 2020-12-05 13:48

I\'m running the Django 1.2 development server and I get these Broken Pipe error messages whenever I load a page from it with Chrome or Safari. My co-worker is getting the e

6条回答
  •  囚心锁ツ
    2020-12-05 14:14

    In the case that this happens with a JavaScript client, a solution could be the following. You have to add preventDefault and return false at beginning and at the end of your event handler like:

    $('#btn_analyze').click(function(e) {
        e.preventDefault()
        $.post('/api/v1/analyzer/',
            data,
            "json").done(function(response) {
            //...
        }).fail(function() {
            Logger.error(" Error ")
        })
    
        return false
    }) // analyze click
    

提交回复
热议问题