在Django中,通过前端访问后端时候,出现下面的错误提示:
AssertionError: Expected a `Response`, `HttpResponse` or `HttpStreamingResponse` to be returned from the view
这个提示比较明显,就是在写完视图之后,没有返回响应给前端,就会报这样的错误;
解决:
看一下你最近新添加的一个或几个视图函数,看在请求处理后,有没有return Response,加上就可以了。
在Django中,通过前端访问后端时候,出现下面的错误提示:
AssertionError: Expected a `Response`, `HttpResponse` or `HttpStreamingResponse` to be returned from the view
这个提示比较明显,就是在写完视图之后,没有返回响应给前端,就会报这样的错误;
解决:
看一下你最近新添加的一个或几个视图函数,看在请求处理后,有没有return Response,加上就可以了。