Hi Ahmed,

In the new release channel layers are optional - if you don't configure
them they will indeed come through as None. The settings format changed
slightly too - you can read more here:
http://channels.readthedocs.io/en/latest/topics/channel_layers.html

Andrew

On Fri, Feb 2, 2018 at 3:31 AM, Ahmed Magdy <[email protected]> wrote:

> I'm relatively new to channels and was using Channels v1.x.x groups
> easily, but after v2.0.0 update and reading the documentation
>
> # This example uses WebSocket consumer, which is synchronous, and so
> # needs the async channel layer functions to be converted.
> from asgiref.sync import AsyncToSync
>
> class ChatConsumer(WebsocketConsumer):
>
>     def connect(self):
>         AsyncToSync(self.channel_layer.group_add)("chat", self.channel_name)
>
>     def disconnect(self):
>         AsyncToSync(self.channel_layer.group_discard)("chat", 
> self.channel_name)
>
> Enter code here...
>
> channel_layer, channel_name are always NoneType and exception occurs.
>
> Is that because I didn't configure channel layers? But in the old version
> I also used the in memory type and Groups were working well.
>
> --
> 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 [email protected].
> To post to this group, send email to [email protected].
> 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/fff84d59-da69-47d5-a7c3-ee0221680642%40googlegroups.com
> <https://groups.google.com/d/msgid/django-users/fff84d59-da69-47d5-a7c3-ee0221680642%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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 [email protected].
To post to this group, send email to [email protected].
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/CAFwN1uqxVR%2BU%3DJFnOnmuBW7CR23A626uqiGuR98%2B9%3DYUi%3DWVCA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to