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