Python 将django从1.11升级到2.0时出现Daphne问题
从django 1.11升级到2.0时,会发生以下情况:Python 将django从1.11升级到2.0时出现Daphne问题,python,django,daphne,Python,Django,Daphne,从django 1.11升级到2.0时,会发生以下情况: Traceback (most recent call last): File "/home/.local/share/virtualenvs/django2/lib/python3.6/site-packages/daphne/http_protocol.py", line 179, in process "server": self.server_addr, TypeError: object() takes no par
Traceback (most recent call last):
File "/home/.local/share/virtualenvs/django2/lib/python3.6/site-packages/daphne/http_protocol.py", line 179, in process
"server": self.server_addr,
TypeError: object() takes no parameters
Django版本2.0.10,Channel=2.1.6,daphne=2.2.4。一旦GET请求发送到localhost:8000,就会发生这种情况。
尝试使用manage.py runserver 0.0.0.0:8000
违规线路:
self.application_queue = self.server.create_application(self, {
"type": "http",
# TODO: Correctly say if it's 1.1 or 1.0
"http_version": self.clientproto.split(b"/")[-1].decode("ascii"),
"method": self.method.decode("ascii"),
"path": unquote(self.path.decode("ascii")),
"root_path": self.root_path,
"scheme": "https" if self.isSecure() else "http",
"query_string": self.query_string,
"headers": self.clean_headers,
"client": self.client_addr,
"server": self.server_addr, # <<<<<<<<< OFFENDING LINE
})
self.application\u queue=self.server.create\u应用程序(self{
“类型”:“http”,
#TODO:正确地说是1.1还是1.0
“http_版本”:self.clientproto.split(b/)[-1]。解码(“ascii”),
“方法”:self.method.decode(“ascii”),
“路径”:unquote(self.path.decode(“ascii”),
“根路径”:self.root\u路径,
“方案”:如果self.isSecure()为“https”,则为“https”,否则为“http”,
“查询字符串”:self.query\u字符串,
“标题”:self.clean_标题,
“客户”:self.client\u addr,
“服务器”:self.server\u addr#