It seems like I cannot get the disconnect function in the consumer to get called at all.
class ChatConsumer(WebsocketConsumer): def connect(self): self.accept() def disconnect(self): print('disconnected') Using self.close from the consumer, or closing the javascript websocket doesn't trigger the print at all, though it does write in the log that the websocket disconnected. [2018/02/06 09:50:32] WebSocket HANDSHAKING /sessions/ [127.0.0.1:7854] [2018/02/06 09:50:32] WebSocket CONNECT /sessions/ [127.0.0.1:7854] [2018/02/06 09:50:39] WebSocket DISCONNECT /sessions/ [127.0.0.1:7854] Am I using it incorrectly? -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/520a3775-4a2b-4f9d-959f-bbe13491f6ab%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.