test for ws

This commit is contained in:
2025-07-15 19:09:45 +08:00
parent 01e5c9097c
commit 4d4ae96022
7 changed files with 93 additions and 2 deletions

11
api/ws.py Normal file
View File

@@ -0,0 +1,11 @@
from channels.generic.websocket import AsyncWebsocketConsumer
class Consumer(AsyncWebsocketConsumer):
async def connect(self):
await self.accept()
async def disconnect(self):
pass
async def receive(self, text_data):
await self.send(text_data=text_data)