如何使用djangoframework修复firefox中的'NoneType'对象错误

时间:2019-06-14 16:37:09

标签: python django browser web-frameworks

当浏览器通过特殊的firefox和IE edge获取数据时,我收到了错误消息附加代码,在chrome中就可以了

我的开发环境是conda 4.6.14 康达包装清单很喜欢那些

asn1crypto                0.24.0                   pypi_0    pypi ca-certificates           2019.5.15                     0 certifi     
2019.3.9                 pypi_0    pypi cffi                      1.12.3                   pypi_0    pypi chardet                   3.0.4                    pypi_0    pypi cryptography              2.7                      pypi_0    pypi django                    2.2.2                    pypi_0    pypi djangorestframework       3.9.4                    pypi_0    pypi idna                      2.8                      pypi_0    pypi openssl                   1.1.1c               he774522_1 pip                       19.1.1                   py37_0 pycparser                 2.19                     pypi_0    pypi pyopenssl                 19.0.0                   pypi_0    pypi python                    3.7.3                h8c8aaf0_1 pytz        
2019.1                   pypi_0    pypi requests                  2.22.0                   pypi_0    pypi setuptools                41.0.1                   py37_0 six                       1.12.0                   pypi_0    pypi sqlite                    3.28.0               he774522_0 sqlparse                  0.3.0                    pypi_0   pypi urllib3                   1.25.3                   pypi_0    pypi vc                        14.1                 h0510ff6_4 vs2015_runtime            14.15.26706          h3a45250_4 wheel       
0.33.4                   py37_0 wincertstore              0.2                      py37_0

我应该认为问题不在于Django项目和应用程序中编写的代码有关。 也许问题出在anaconda系统上。 我不知道。

调用堆栈与我联系在一起。

Not Found: /favicon.ico
[15/Jun/2019 01:14:44] "GET /favicon.ico HTTP/1.1" 404 2077
Traceback (most recent call last):
  File "C:\Users\sam\Anaconda3\envs\drfenv\lib\wsgiref\handlers.py", line 138, in run
    self.finish_response()
  File "C:\Users\sam\Anaconda3\envs\drfenv\lib\wsgiref\handlers.py", line 180, in finish_response
    self.write(data)
  File "C:\Users\sam\Anaconda3\envs\drfenv\lib\wsgiref\handlers.py", line 274, in write
    self.send_headers()
  File "C:\Users\sam\Anaconda3\envs\drfenv\lib\wsgiref\handlers.py", line 332, in send_headers
    self.send_preamble()
  File "C:\Users\sam\Anaconda3\envs\drfenv\lib\wsgiref\handlers.py", line 255, in send_preamble
    ('Date: %s\r\n' % format_date_time(time.time())).encode('iso-8859-1')
  File "C:\Users\sam\Anaconda3\envs\drfenv\lib\wsgiref\handlers.py", line 453, in _write
    result = self.stdout.write(data)
  File 'C:\Users\sam\Anaconda3\envs\drfenv\lib\socketserver.py', line 799, in write
    self._sock.sendall(b)
ConnectionAbortedError: [WinError 10053] Current connection is stopped by user host system sofreware
[15/Jun/2019 01:14:44] "GET /favicon.ico HTTP/1.1" 500 59
----------------------------------------
Exception happened during processing of request from ('127.0.0.1', 13157)
Traceback (most recent call last):
  File "C:\Users\sam\Anaconda3\envs\drfenv\lib\wsgiref\handlers.py", line 138, in run
    self.finish_response()
  File "C:\Users\sam\Anaconda3\envs\drfenv\lib\wsgiref\handlers.py", line 180, in finish_response
    self.write(data)
  File "C:\Users\sam\Anaconda3\envs\drfenv\lib\wsgiref\handlers.py", line 274, in write
    self.send_headers()
  File "C:\Users\sam\Anaconda3\envs\drfenv\lib\wsgiref\handlers.py", line 332, in send_headers
    self.send_preamble()
  File "C:\Users\sam\Anaconda3\envs\drfenv\lib\wsgiref\handlers.py", line 255, in send_preamble
    ('Date: %s\r\n' % format_date_time(time.time())).encode('iso-8859-1')
  File "C:\Users\sam\Anaconda3\envs\drfenv\lib\wsgiref\handlers.py", line 453, in _write
    result = self.stdout.write(data)
  File "C:\Users\sam\Anaconda3\envs\drfenv\lib\socketserver.py", line 799, in write
    self._sock.sendall(b)
ConnectionAbortedError: [WinError 10053] Current connection is stopped by user host system sofreware

在处理上述异常期间,发生了另一个异常:

Traceback (most recent call last):
  File "C:\Users\sam\Anaconda3\envs\drfenv\lib\wsgiref\handlers.py", line 141, in run
    self.handle_error()
  File "C:\Users\sam\Anaconda3\envs\drfenv\lib\site-packages\django\core\servers\basehttp.py", line 116, in handle_error
    super().handle_error()
  File "C:\Users\sam\Anaconda3\envs\drfenv\lib\wsgiref\handlers.py", line 368, in handle_error
    self.finish_response()
  File "C:\Users\sam\Anaconda3\envs\drfenv\lib\wsgiref\handlers.py", line 180, in finish_response
    self.write(data)
  File "C:\Users\sam\Anaconda3\envs\drfenv\lib\wsgiref\handlers.py", line 274, in write
    self.send_headers()
  File "C:\Users\sam\Anaconda3\envs\drfenv\lib\wsgiref\handlers.py", line 331, in send_headers
    if not self.origin_server or self.client_is_modern():
  File "C:\Users\sam\Anaconda3\envs\drfenv\lib\wsgiref\handlers.py", line 344, in client_is_modern
    return self.environ['SERVER_PROTOCOL'].upper() != 'HTTP/0.9'
TypeError: 'NoneType' object is not subscriptable

在处理上述异常期间,发生了另一个异常:

Traceback (most recent call last):
  File "C:\Users\sam\Anaconda3\envs\drfenv\lib\socketserver.py", line 650, in process_request_thread
    self.finish_request(request, client_address)
  File "C:\Users\sam\Anaconda3\envs\drfenv\lib\socketserver.py", line 360, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "C:\Users\sam\Anaconda3\envs\drfenv\lib\socketserver.py", line 720, in __init__
    self.handle()
  File "C:\Users\sam\Anaconda3\envs\drfenv\lib\site-packages\django\core\servers\basehttp.py", line 171, in handle
    self.handle_one_request()
  File "C:\Users\sam\Anaconda3\envs\drfenv\lib\site-packages\django\core\servers\basehttp.py", line 194, in handle_one_request
    handler.run(self.server.get_app())
  File "C:\Users\sam\Anaconda3\envs\drfenv\lib\wsgiref\handlers.py", line 144, in run
    self.close()
  File "C:\Users\sam\Anaconda3\envs\drfenv\lib\site-packages\django\core\servers\basehttp.py", line 111, in close
    super().close()
  File "C:\Users\sam\Anaconda3\envs\drfenv\lib\wsgiref\simple_server.py", line 35, in close
    self.status.split(' ',1)[0], self.bytes_sent
AttributeError: 'NoneType' object has no attribute 'split'

0 个答案:

没有答案