错误类型:
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 inner
response = 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 inner
response = 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)
教训:
一定要细心,每个流程都要按照固定的格式去走,因为编程思想是自由的,但是语法和格式是死的,死的,死的!!!
解决方案(二)提示: