我正在使用测试服务器测试一个 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 上以及任何其他意见或建议,我们将不胜感激。预先感谢您的时间和考虑。
最佳答案
MusicGrep/musicgrep/views.py
没有返回 HttpResponse 实例
关于python - AttributeError: 'search' 对象在 Django 项目中没有属性 'status_code',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5532546/