Titivillus/quest/consumers.py

21 lines
409 B
Python
Raw Normal View History

2018-08-14 20:12:52 -04:00
#!/usr/bin/env python3
"""
Consumers available for the /quest websocket.
"""
from channels.generic.websocket import WebsocketConsumer
class QuestConsumer(WebsocketConsumer):
"""
The main consumer for /quest websockets.
"""
def connect(self):
self.accept()
self.send('message: connected')
def disconnect(self):
pass
def receive(self, text_data):
print(text_data)
self.send("message: lol}")