Django Channels Unresolved Import channels.generic.websockets
See original GitHub issue- GraphQL AioWS version: Django 2.1.5
- Python version: Python 3.6.6 :: Anaconda, Inc.
- Operating System: macOS Mojave 10.14
Description
I’m trying to set up GraphQL Subscriptions with Django Channels 2, but the code keeps on throwing this error: ModuleNotFoundError: No module named ‘channels.generic.websockets’
What I Did
I checked the Django Channels docs and also the source code of graphql_ws and figured a typo: In the first line of django_channels.py, instead of
from channels.generic.websockets import JsonWebsocketConsumer
should be
from channels.generic.websocket import JsonWebsocketConsumer
reference: https://channels.readthedocs.io/en/latest/topics/consumers.html#jsonwebsocketconsumer
python manage.py runserver
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:11 (1 by maintainers)
Top Results From Across the Web
Why does django-channels not connect to secure Websockets ...
I was able to connect on localhost with some changes. Before that changes it does not work even for ws:// protocol. So my...
Read more >Channels Documentation
Channels is a project that takes Django and extends its abilities beyond HTTP - to handle WebSockets, chat protocols,.
Read more >Simple example of using channels in django web framework
Implement django-channels with how-to, Q&A, fixes, code snippets. kandi ratings ... from channels.generic.websocket import AsyncWebsocketConsumer class ...
Read more >Sending notifications with Django channels
I use Django Channel for sending notifications to users who are ... from channels.generic.websocket import AsyncJsonWebsocketConsumer from ...
Read more >Django Channels 2.0 websocket crashing & blocking while ...
from channels.generic.websocket import AsyncWebsocketConsumer. import json. class MyConsumer(AsyncWebsocketConsumer):. async def connect(self):.
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
Django v2+ compatible version merged to master!
Well at least I got that part right, switching to Node…
HAHAHAHA…