Django channels on prod with redis server

Dear,

I was using django channels on dev environment locally and it works perfectly for chatting and notifications services.
When it comes to deploying, only chatting works fine with

    "BACKEND": "channels.layers.InMemoryChannelLayer", 

which is not recommended firstly and secondly because invoking the consumer from javascript. However, notification service is not working on prod because the invoking the consumer is from python side.

So I installed redis server on my instance and it is working fine and ping pong is successfully done.
But, when it comes to connect it to my django settings like it is mentioned below:

CHANNEL_LAYERS = {
   "default": {
        "BACKEND": "channels_redis.core.RedisChannelLayer",
        "CONFIG": {
                "hosts": [("127.0.0.1", 6379)],
        },
        "ROUTING": "NotificationsApp.routing.websocket_urlpatterns",
   },
}

it doesn’t work and even the connection with WS server doesn’t work.
Could you please help me with this issue ?
Thanks in advance

First, if this is your CHANNEL_LAYERS configuration - and if it’s working for you, you’re still using Channels 1? If so you should upgrade to the current version.

Second, you need to be more specific and provide more details about

What is the behavior you’re seeing? Are you getting any error messages? What “connection with the WS server” are you talking about?