欢迎来到夜的世界

莫听穿林打叶声,何妨吟啸且徐行。竹杖芒鞋轻胜马,谁怕?一蓑烟雨任平生.料峭春风吹酒醒,微冷,山头斜照却相迎。回首向来萧瑟处,归去,也无风雨也无晴。
扩大
缩小

django正常运行确报错的解决方法

django正常运行却报错的处理方法

出处 : https://www.infvie.com/ops-notes/django-normal-operation-error

报错一:self._sock.sendall(b) ConnectionAbortedError: [WinError 10053] 您的主机中的软件中止了一个已建立的连接。

解决方法:找到python/Lib/socketserver.py文件,修改SocketWriter类的write方法,具体如下:

def write(self, b):
    try:
        self._sock.sendall(b)
    except Exception as e:
        self._sock.close()
    with memoryview(b) as view:
        return view.nbytes

 

报错二:return self.environ[‘SERVER_PROTOCOL’].upper() != 'HTTP/0.9 TypeError: ‘NoneType’ object is not subscriptable

解决方法:打开python\lib\wsgiref\handlers.py文件,修改client_is_modern函数,具体如下:

def client_is_modern(self):
    """True if client can accept status and headers"""
    try:
        cmp = self.environ['SERVER_PROTOCOL'].upper() != 'HTTP/0.9'
    except Exception as e:
        cmp = False
    return cmp

 

报错三:self.status.split(’ ',1)[0], self.bytes_sent AttributeError: ‘NoneType’ object has no attribute 'split

解决方法:打开python\lib\wsgiref\simple_server.py文件,修改ServerHandler类,具体如下:

class ServerHandler(SimpleHandler):
    server_software = software_version

    def close(self):
        try:
            self.request_handler.log_request(
                self.status.split(' ', 1)[0], self.bytes_sent
            )
            SimpleHandler.close(self)
        except Exception as e:
            SimpleHandler.close(self)

 

报错四:“GET /favicon.ico HTTP/1.1” 404 3163

解决方法:在static文件下的image文件添加一个favicon.ico图片,然后在页面头部加入

注:具体路径看自己定义的内容,或有差异.

 

报错五:GET /c_hello?asker=backuper HTTP/1.1" 404 3166 Not Found: /c_hello

解决方法:暂时未找到!!!有懂得解决的希望分享一下,或者我后续找到了再更新一下。

 
 
 

posted on 2019-08-06 20:04  二十四桥_明月夜  阅读(1162)  评论(0编辑  收藏  举报

导航