我正在使用测试服务器测试django项目,但它给我返回以下异常:
Traceback (most recent call last): File "/usr/lib/pymodules/python2.6/django/core/servers/basehttp.py", line 280, in run self.result = application(self.environ, self.start_response) File "/usr/lib/pymodules/python2.6/django/core/servers/basehttp.py", line 674, in >call return self.application(environ, start_response) File "/usr/lib/pymodules/python2.6/django/core/handlers/wsgi.py", line 245, in call response = middleware_method(request, response) File "/usr/lib/pymodules/python2.6/django/middleware/common.py", line 84, in >process_response if response.status_code == 404: AttributeError: 'search' object has no attribute 'status_code'
仅从这个回溯信息来看,我不认为问题出在我的代码上,但我也不确定。是否有人可以浏览我的代码并帮助我解决这个问题?我的代码托管在GitHub上,如下所示:链接,任何其他评论或建议都将不胜感激。感谢您花费时间和考虑。
Traceback (most recent call last): File "/usr/lib/pymodules/python2.6/django/core/servers/basehttp.py", line 280, in run self.result = application(self.environ, self.start_response) File "/usr/lib/pymodules/python2.6/django/core/servers/basehttp.py", line 674, in >call return self.application(environ, start_response) File "/usr/lib/pymodules/python2.6/django/core/handlers/wsgi.py", line 245, in call response = middleware_method(request, response) File "/usr/lib/pymodules/python2.6/django/middleware/common.py", line 84, in >process_response if response.status_code == 404: AttributeError: 'search' object has no attribute 'status_code'
仅从这个回溯信息来看,我不认为问题出在我的代码上,但我也不确定。是否有人可以浏览我的代码并帮助我解决这个问题?我的代码托管在GitHub上,如下所示:链接,任何其他评论或建议都将不胜感激。感谢您花费时间和考虑。
search
返回的是什么?肯定不是 HttpResponse 实例 - 这正是你问题的根源。 - Jerzyk.gitignore
阅读pep8 http://www.python.org/dev/peps/pep-0008/ - Jerzyk