相关疑难解决方法(0)

如何解决 AssertionError: .accepted_renderer not set on Response in django and ajax

当我在 ajax 中调用 Django url 时,出现以下错误

断言错误:.accepted_renderer 未在响应中设置。

这是我的代码:

function download(){

    $.ajax({
        url: "/mdm/exam_app/get_assessment_count/",
        dataType: 'json',
        data:{
        },
        type:'GET',
        success: function (data) {
          alert("inside the success method");
    },
        error: function(){
          console.log("error");
          }        
      });
}
Run Code Online (Sandbox Code Playgroud)

django ajax

29
推荐指数
2
解决办法
3万
查看次数

标签 统计

ajax ×1

django ×1