fixed up the docker

This commit is contained in:
Jonas Winkler committed 2020-11-07 12:47:17 +01:00
1 parent b0465e65c3
commit ae8a048ea6
7 files changed
+37 -28

No files matched your search

+16
View File
@@ -0,0 +1,16 @@
import json
from asgiref.sync import async_to_sync
from channels.generic.websocket import WebsocketConsumer
class StatusConsumer(WebsocketConsumer):
def connect(self):
self.accept()
async_to_sync(self.channel_layer.group_add)('status_updates', self.channel_name)
def disconnect(self, close_code):
async_to_sync(self.channel_layer.group_discard)('status_updates', self.channel_name)
def status_update(self, event):
self.send(json.dumps(event['data']))