11 lines
260 B
Python
11 lines
260 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':'You are now connected!'
|
|
}))
|