import json from channels.generic.websocket import WebsocketConsumer class ChatConsumer(WebsocketConsumer): def connect(self): self.accept() self.send(text_data=json.dumps({ 'type':'connection_established', 'message':'Your are now connected', })) def receive(): def disconnect():