def initialize(self, *args, **kwargs):
    _connections[id(self)] = self
super(ConnectNamespace, self).initialize(*args, **kwargs)

def disconnect(self, *args, **kwargs):
    del _connections[id(self)]
super(ConnectNamespace, self).disconnect(*args, **kwargs)
Как генерировать событие Socket IO на стороне сервера