Django错误什么都不做?

时间:2018-05-31 04:17:44

标签: python django python-3.x

我的项目在django 2.0,python 3.x中,我认为当我进入django管理员时,我得到了这一系列的引用和红色字母,我认为是某种错误,我只是不知道它是什么

ERROR什么都不做:ERROR什么都不做:

Traceback (most recent call last):   File "C:\Users\Andre\Anaconda3\lib\wsgiref\handlers.py", line 138, in run
    self.finish_response()   File "C:\Users\Andre\Anaconda3\lib\wsgiref\handlers.py", line 180, in finish_response
    self.write(data)   File "C:\Users\Andre\Anaconda3\lib\wsgiref\handlers.py", line 274, in write
    self.send_headers()   File "C:\Users\Andre\Anaconda3\lib\wsgiref\handlers.py", line 332, in send_headers
    self.send_preamble()   File "C:\Users\Andre\Anaconda3\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\Andre\Anaconda3\lib\wsgiref\handlers.py", line 453, in
_write
    result = self.stdout.write(data)   File "C:\Users\Andre\Anaconda3\lib\socketserver.py", line 775, in write
    self._sock.sendall(b) ConnectionAbortedError: [WinError 10053] Se ha anulado una conexión establecida por el software en su equipo host [30/May/2018 14:06:28] "GET /static/admin/css/changelists.css HTTP/1.1" 500 59
---------------------------------------- Exception happened during processing of request from ('127.0.0.1', 61210) [30/May/2018 14:06:28] "GET /static/admin/js/jquery.init.js HTTP/1.1" 200 363 Traceback (most recent call last):   File "C:\Users\Andre\Anaconda3\lib\wsgiref\handlers.py", line 138, in run
    self.finish_response()   File "C:\Users\Andre\Anaconda3\lib\wsgiref\handlers.py", line 180, in finish_response
    self.write(data)   File "C:\Users\Andre\Anaconda3\lib\wsgiref\handlers.py", line 274, in write
    self.send_headers()   File "C:\Users\Andre\Anaconda3\lib\wsgiref\handlers.py", line 332, in send_headers
    self.send_preamble()   File "C:\Users\Andre\Anaconda3\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\Andre\Anaconda3\lib\wsgiref\handlers.py", line 453, in
_write
    result = self.stdout.write(data)   File "C:\Users\Andre\Anaconda3\lib\socketserver.py", line 775, in write
    self._sock.sendall(b) ConnectionAbortedError: [WinError 10053] Se ha anulado una conexión establecida por el software en su equipo host

During handling of the above exception, another exception occurred:

Traceback (most recent call last):   File "C:\Users\Andre\Anaconda3\lib\wsgiref\handlers.py", line 141, in run
    self.handle_error()   File "C:\Users\Andre\Desktop\Django_projects\Pycharm\Interpretes\lib\site-packages\django\core\servers\basehttp.py", line 86, in handle_error
    super().handle_error()   File "C:\Users\Andre\Anaconda3\lib\wsgiref\handlers.py", line 368, in handle_error
    self.finish_response()   File "C:\Users\Andre\Anaconda3\lib\wsgiref\handlers.py", line 180, in finish_response
    self.write(data)   File "C:\Users\Andre\Anaconda3\lib\wsgiref\handlers.py", line 274, in write
    self.send_headers()   File "C:\Users\Andre\Anaconda3\lib\wsgiref\handlers.py", line 331, in send_headers
    if not self.origin_server or self.client_is_modern():   File "C:\Users\Andre\Anaconda3\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

During handling of the above exception, another exception occurred:

Traceback (most recent call last):   File "C:\Users\Andre\Anaconda3\lib\socketserver.py", line 639, in process_request_thread
    self.finish_request(request, client_address)   File "C:\Users\Andre\Anaconda3\lib\socketserver.py", line 361, in finish_request
    self.RequestHandlerClass(request, client_address, self)   File "C:\Users\Andre\Anaconda3\lib\socketserver.py", line 696, in __init__
    self.handle()   File "C:\Users\Andre\Desktop\Django_projects\Pycharm\Interpretes\lib\site-packages\django\core\servers\basehttp.py", line 154, in handle
    handler.run(self.server.get_app())   File "C:\Users\Andre\Anaconda3\lib\wsgiref\handlers.py", line 144, in run
    self.close()   File "C:\Users\Andre\Anaconda3\lib\wsgiref\simple_server.py", line 35, in close
    self.status.split(' ',1)[0], self.bytes_sent AttributeError: 'NoneType' object has no attribute 'split'
它显然什么也没做,只是吓死了我,如果有人有任何想法请赐教。 我认为它可能会或可能不会阻止服务器运行,但我不确定当我在AWS的ec2实例中运行它时,在我的IDE pycharm中,控制台会充满这一点。

1 个答案:

答案 0 :(得分:2)

您有一个未设置的名为SERVER_PROTOCOL的环境变量。

尝试为其提供HTTP/0.9

等值

这只会修复此错误。不确定是否还有其他错误。

在Windows PowerShell中设置环境变量:

setx SERVER_PROTOCOL "HTTP/0.9"

然后重启并命令提示符。