我是django频道的新手。我阅读this tutorial来创建实时聊天应用程序,但我有这个错误
Chrome中的:
WebSocket connection to 'ws://127.0.0.1:8000/chat/stream/' failed: WebSocket is
closed before the connection is established.
:
Firefox can't establish a connection to the server at ws://127.0.0.1:8001/chat/stream/.
The connection to ws://127.0.0.1:8001/chat/stream/ was interrupted while the page was loading.
请帮帮我。非常感谢。
答案 0 :(得分:0)
您可能会在代码中遗漏这个:
message.reply_channel.send({"accept": True})
ws_connect
中的