Re: How to call AsyncWebsocketConsumer functions from different files in Django

2023-04-25 Thread aschoo...@gmail.com
how does the class bit work On Friday, November 25, 2022 at 2:23:15 AM UTC-7 ansarih...@gmail.com wrote: > [image: Screenshot 2022-11-25 145248.png] > > On Friday, November 25, 2022 at 2:47:12 PM UTC+5:30 MD Hassan Ansari wrote: > >> >>- this is consumers.py >> >> class ChatConsumer(AsyncWebs

Re: How to call AsyncWebsocketConsumer functions from different files in Django

2022-11-25 Thread MD Hassan Ansari
[image: Screenshot 2022-11-25 145248.png] On Friday, November 25, 2022 at 2:47:12 PM UTC+5:30 MD Hassan Ansari wrote: > >- this is consumers.py > > class ChatConsumer(AsyncWebsocketConsumer): >async def receive(self, text_data): >

How to call AsyncWebsocketConsumer functions from different files in Django

2022-11-25 Thread MD Hassan Ansari
- this is consumers.py class ChatConsumer(AsyncWebsocketConsumer): async def receive(self, text_data): pass - this is my view.py class CreateChatMessageView(APIView): ... message_obj = Ch

How to call AsyncWebsocketConsumer functions from different files in Django

2022-11-25 Thread MD Hassan Ansari
- - this is consumers.py class ChatConsumer(AsyncWebsocketConsumer): async def receive(self, text_data): pass - this is my view.py class CreateChatMessageView(APIView): ... message_obj = ChatMessage.objects.create(chat_room=chat_room_obj, sender_id=sender_id,