ft_transcendence/frontend/consumers.py
2023-11-22 15:50:42 +01:00

16 lines
299 B
Python

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():