from channels.auth import channel_session_user, channel_session_user_from_http


@channel_session_user_from_http
def ws_connect(message):
    message.reply_channel.send({
        'accept': True
    })

from channels import Group
from channels.auth import channel_session_user, channel_session_user_from_http


@channel_session_user_from_http
def ws_connect(message):

    Group('btc-price').add(message.reply_channel)

    message.reply_channel.send({
        'accept': True
    })

Add user to the group when he first connects
Add user to the group when he first connects

+ from channels import Group
  from channels.auth import channel_session_user, channel_session_user_from_http
  
  
  @channel_session_user_from_http
  def ws_connect(message):
+ 
+     Group('btc-price').add(message.reply_channel)
+ 
      message.reply_channel.send({
          'accept': True
      })
  
Add user to the group when he first connects
## Code Before:
from channels.auth import channel_session_user, channel_session_user_from_http


@channel_session_user_from_http
def ws_connect(message):
    message.reply_channel.send({
        'accept': True
    })

## Instruction:
Add user to the group when he first connects
## Code After:
from channels import Group
from channels.auth import channel_session_user, channel_session_user_from_http


@channel_session_user_from_http
def ws_connect(message):

    Group('btc-price').add(message.reply_channel)

    message.reply_channel.send({
        'accept': True
    })
