本文主要是介绍ValueError: The view webapp.views.xxxxxx didn't return an HttpResponse object. It returned None inst,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
错误类型:
Internal Server Error: /report/add_work_history/
Traceback (most recent call last):File "D:\language\Python\Python36\lib\site-packages\django\core\handlers\exception.py", line 34, in innerresponse = get_response(request)File "D:\language\Python\Python36\lib\site-packages\django\core\handlers\base.py", line 126, in _get_response"returned None instead." % (callback.__module__, view_name)
ValueError: The view webapp.views.add_work_history didn't return an HttpResponse object. It returned None instead.
[ERROR][2019-06-27 16:30:03,262][log.py:228]Internal Server Error: /report/add_work_history/
Traceback (most recent call last):File "D:\language\Python\Python36\lib\site-packages\django\core\handlers\exception.py", line 34, in innerresponse = get_response(request)File "D:\language\Python\Python36\lib\site-packages\django\core\handlers\base.py", line 126, in _get_response"returned None instead." % (callback.__module__, view_name)
ValueError: The view webapp.views.add_work_history didn't return an HttpResponse object. It returned None instead.
[27/Jun/2019 16:30:03] "POST /report/add_work_history/ HTTP/1.1" 500 17766
解决方案(一)提示:
忘记加上 return 了
def add_work_history(request):"""添加工作经验:param request::return:"""return report.add_work_history(request)
教训:
一定要细心,每个流程都要按照固定的格式去走,因为编程思想是自由的,但是语法和格式是死的,死的,死的!!!
解决方案(二)提示:
检查各方法是否忘记加 return 后面的方法名了?
这篇关于ValueError: The view webapp.views.xxxxxx didn't return an HttpResponse object. It returned None inst的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!