从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 parameters
Django版本2.0.10,channels = 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
})