小编Sen*_*ath的帖子

Django daphne asgi:Django 只能处理 ASGI/HTTP 连接,不能处理 websocket

这真的很令人沮丧,我确实根据文档设置了所有内容,但是当我尝试独立运行 daphne 时,它​​不断抛出错误,当我使用python manage.py run server. 这非常令人沮丧,我似乎在其他任何地方都找不到类似的错误

2020-01-25 09:57:17,627 INFO     Starting server at tcp:port=8000:interface=127.0.0.1
2020-01-25 09:57:17,628 INFO     HTTP/2 support not enabled (install the http2 and tls Twisted extras)
2020-01-25 09:57:17,628 INFO     Configuring endpoint tcp:port=8000:interface=127.0.0.1
2020-01-25 09:57:17,629 INFO     Listening on TCP address 127.0.0.1:8000
127.0.0.1:44516 - - [25/Jan/2020:09:57:27] "WSCONNECTING /ws/score/" - -
2020-01-25 09:57:28,637 ERROR    Exception inside application: Django can only handle ASGI/HTTP connections, not websocket.
  File "/home/sofdeath/.local/lib/python3.7/site-packages/daphne/cli.py", line 30, in asgi
    await self.app(scope, receive, send)
  File "/home/sofdeath/.local/lib/python3.7/site-packages/django/core/handlers/asgi.py", line 146, …
Run Code Online (Sandbox Code Playgroud)

django daphne asgi

18
推荐指数
1
解决办法
5774
查看次数

标签 统计

asgi ×1

daphne ×1

django ×1