title: How to handle single websocket connection for all chats in Django Channels
body: <p>I want to make a chat application like WhatsApp, and I want to make the backend server using Django Channels to handle all the real-time updates.</p>
  
  <p>I have been exploring various sources but I could not figure out one thing about how do i manage single websocket connection (single endpoint) for each user and still receive messages from all the chats he is part of in real time. As per my current understanding, I can add channel(web socket connection corresponding to a user) to different channel groups but what if a user is part of a lot of groups(basically is eligible to receive updates from various chats)? Should I add that channel to all the groups, he can be part of as soon as the connection is established or is there any workaround like one in my mind:</p>
  
  <ol>
  <li>Store the list of channels corresponding to each user in a database.</li>
  <li>Make a <code>for</code> loop so that whenever a message is received by server, it sends message to websocket connections corresponding to each user involved to receive that message?</li>
  </ol>
  
  <p>Any help is appreciated. Thanks in advance.</p>