I am deploying a project that uses Django Channels to create websockets.
I have deployed this project, but noticed that I cannot connect to my websocket in production. This is a link to the full traceback I am getting:
https://paste.pythondiscord.com/bijutukole.py
I am using Daphne to run both HTTP and Websocket requests. These are the settings I have in asgi.py:
import os
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'signup.settings')
import django
django.setup()
application = ProtocolTypeRouter({
"http": get_asgi_application(),
"websocket": AllowedHostsOriginValidator(
JwtAuthMiddlewareStack(
URLRouter(websocket_urlpatterns)
)
)
})
and in settings.py I made sure all references to Redis refer to my the service address of my deployed Redis instance:
CHANNEL_LAYERS = {
"default": {
"BACKEND": "channels_redis.core.RedisChannelLayer",
"LOCATION": "redis://redis-kufk:10000",
},
}