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(

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,