Error: Django can only handle ASGI/HTTP connections, not websocket.
See original GitHub issuemy setup:
Django==3.0.3
channels==2.4.0
channels-redis==2.4.2
daphne==2.4.1
run command:
daphne myproduct.asgi:application
I got 500 server error when I connenct websocket .
log:
127.0.0.1:54023 - - [12/Mar/2020:16:51:21] "WSCONNECTING /ws/robot" - -
2020-03-12 16:51:22,104 ERROR Exception inside application: Django can only handle ASGI/HTTP connections, not websocket.
File "/Users/xx/project/xx/venv/lib/python3.7/site-packages/daphne/cli.py", line 30, in asgi
await self.app(scope, receive, send)
File "/Users/xx/project/xx/venv/lib/python3.7/site-packages/django/core/handlers/asgi.py", line 146, in __call__
% scope['type']
Django can only handle ASGI/HTTP connections, not websocket.
127.0.0.1:54023 - - [12/Mar/2020:16:51:22] "WSDISCONNECT /ws/robot" - -
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Django can only handle ASGI/HTTP connections, not websocket
I initially thought it didn't, because I didn't see that it also changed from django.core.asgi import get_asgi_application to from channels.
Read more >Django can only handle ASGI/HTTP connections, not ...
Coding example for the question Django daphne asgi: Django can only handle ASGI/HTTP connections, not websocket-django.
Read more >Django can only handle ASGI/HTTP connections, not websocket
Answer a question Hello I am getting a error. Before coming here, I tried many different ways and looked at the topics that...
Read more >How to Add Websockets to a Django App without Extra ...
In this post, you'll learn how to handle Websockets with Django by ... Django 3.0 is only compatible with Python 3.6 and up...
Read more >daphne - PyPI
Django ASGI (HTTP /WebSocket) server. ... Daphne only supports “normal” requests over HTTP/2 at this time; there is not yet support for extended...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @jack-michaud. Yes. Currently this is the case. It’s a difference between ASGI v2 and v3.
Progress for this should be made in #1421 by @jaydenwindle. At that point we should be able to accept a single callable (the ASGI v3 version that Django’s new code implements) and the idea above should hold. 🤞
Goal now is a channels update to use ASGI 3 (allowing fallback for existing apps) throughout. I have stuff for the next version of DRF top of my list, and then it’s Channels after that. If you fancy lending a hand, that would be super.
Hey everyone, when I change
django.core.asgi.get_asgi_application
tofrom channels.routing import get_default_application
, it gives me this error:django.core.exceptions.AppRegistryNotReady: Apps aren't loaded yet.
This is the full traceback: