1
>Traceback (most recent call last):
> File "C:\Python27\lib\wsgiref\handlers.py", line 86, in run
>    self.finish_response()
>Traceback (most recent call last):
>  File "C:\Python27\lib\wsgiref\handlers.py", line 127, in finish_response
>Traceback (most recent call last):
>  File "C:\Python27\lib\wsgiref\handlers.py", line 86, in run
>  File "C:\Python27\lib\wsgiref\handlers.py", line 86, in run
>    self.finish_response()
>  File "C:\Python27\lib\wsgiref\handlers.py", line 127, in finish_response
>    self.write(data)
>    self.finish_response()
>  File "C:\Python27\lib\wsgiref\handlers.py", line 210, in write
>  File "C:\Python27\lib\wsgiref\handlers.py", line 127, in finish_response
>    self.write(data)
>  File "C:\Python27\lib\wsgiref\handlers.py", line 210, in write
>    self.send_headers()
>    self.write(data)
>  File "C:\Python27\lib\wsgiref\handlers.py", line 268, in send_headers
>Traceback (most recent call last):
>  File "C:\Python27\lib\wsgiref\handlers.py", line 210, in write
>  File "C:\Python27\lib\wsgiref\handlers.py", line 86, in run
>    self.send_preamble()
>    self.send_headers()
>    self.finish_response()
>  File "C:\Python27\lib\wsgiref\handlers.py", line 268, in send_headers
>  File "C:\Python27\lib\wsgiref\handlers.py", line 127, in finish_response
>    self.send_preamble()
>    self.send_headers()
>  File "C:\Python27\lib\wsgiref\handlers.py", line 192, in send_preamble
>[27/Aug/2012 10:30:06] "GET /index/ HTTP/1.1" 200 6309
>  File "C:\Python27\lib\wsgiref\handlers.py", line 192, in send_preamble
>  File "C:\Python27\lib\wsgiref\handlers.py", line 268, in send_headers
>    self.write(data)
>  File "C:\Python27\lib\wsgiref\handlers.py", line 210, in write
>    'Date: %s\r\n' % format_date_time(time.time())
>    'Date: %s\r\n' % format_date_time(time.time())
>  File "C:\Python27\lib\socket.py", line 324, in write
>  File "C:\Python27\lib\socket.py", line 324, in write
>    self.send_preamble()
>  File "C:\Python27\lib\wsgiref\handlers.py", line 192, in send_preamble
>    self.send_headers()
>  File "C:\Python27\lib\wsgiref\handlers.py", line 268, in send_headers
>    'Date: %s\r\n' % format_date_time(time.time())
>  File "C:\Python27\lib\socket.py", line 324, in write
>    self.send_preamble()
>  File "C:\Python27\lib\wsgiref\handlers.py", line 192, in send_preamble
>   self.flush()
>    self.flush()
>    self.flush()
>  File "C:\Python27\lib\socket.py", line 303, in flush
>  File "C:\Python27\lib\socket.py", line 303, in flush
>  File "C:\Python27\lib\socket.py", line 303, in flush
>    self._sock.sendall(view[write_offset:write_offset+buffer_size])
>    'Date: %s\r\n' % format_date_time(time.time())
>  File "C:\Python27\lib\socket.py", line 324, in write
>    self._sock.sendall(view[write_offset:write_offset+buffer_size])
>    self._sock.sendall(view[write_offset:write_offset+buffer_size])
>error: [Errno 10053] An established connection was aborted by the software in your host machine
4

1 回答 1

1

检查您的 urls.py 文件。当我遇到这个问题时,这是由于这行代码的粗体部分:

url((r'^foo/(?P<thing1>[a-zA-Z0-9\-_]+),**(?P<thing2>%s**' % REGEX), 'views.foo'),

请注意缺少关闭括号。这显然导致整个事情变得混乱,吐出你在这里遇到的同样类型的错误。因此,请检查缺少的括号和错误的正则表达式语法——我敢打赌,其中之一是您问题的根源。

于 2013-01-18T19:18:17.087 回答