Enabling a channel layer
Channel layers allow you to communicate between different instances of an application. A channel layer is the transport mechanism that allows multiple consumer instances to communicate with each other and with other parts of Django.
In your chat server, you plan to have multiple instances of the ChatConsumer
consumer for the same course chat room. Each student who joins the chat room will instantiate the WebSocket client in their browser, and that will open a connection with an instance of the WebSocket consumer. You need a common channel layer to distribute messages between consumers.
Channels and groups
Channel layers provide two abstractions to manage communications: channels and groups: