# chat/consumers.py import json from channels.generic.websocket import WebsocketConsumer import wsps.tasks_loop class ChatConsumer(WebsocketConsumer): def connect(self): p("!!!!!!!!!!!!!!!!!!!!") self.accept() def disconnect(self, close_code): pass def receive(self, text_data): text_data_json = json.loads(text_data) message = text_data_json['message'] self.send(text_data=json.dumps({ 'message': message })) self.send(text_data=json.dumps({ 'message': {"abc":123} })) print(">>>>>>>>>>>>>") print("++..",end="\n",flush=True) # print("++",end="\n",flush=True)