Below code prints the channel_name of a client
class ChatConsumer(WebsocketConsumer): def connect(self): self.room_name = self.scope[\'url_route\'