我还不明白为什么会出现“HttpResponse”错误。在
Traceback (most recent call last):
File "C:\Python27\Scripts\covaenv\lib\site-packages\django\core\handlers\exception.py", line 42, in inner
response = get_response(request)
File "C:\Python27\Scripts\covaenv\lib\site-packages\django\core\handlers\base.py", line 198, in _get_response
"returned None instead." % (callback.__module__, view_name)
ValueError: The view exampleapp.views.get_recieve_update didn't return an HttpResponse object. It returned None instead.
此视图负责从API获取POST请求,并加载数据并对其执行操作。在
观点:
^{pr2}$我错过了什么?在
您需要在每个条件。在最后一个if-else语句没有从视图中返回任何内容,因此必须为视图中的每个情况返回适当的http响应。请参阅下面的更新代码。在
Another Helpful answer
相关问题 更多 >
编程相关推荐