[Django]-Django channels websocket closes during handshake

6👍

You’re using the synchronous WebSocketConsumer whereas you’ve re-written your code to be asynchronous. You should therefore write:

class ChatConsumer(AsyncWebsocketConsumer):

Compare your consumers.py to that in the tutorial.

Leave a comment