Issues deploying Django Channels

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",
    },
}

Hi there,

I noticed you were able to deploy your application successfully, are you still having trouble connecting to your websockets?

Hi Tyler,

Yes, I deployed the application, but still having issues connecting to the websocket through Django Channels, even though I can do this locally

FYI: these are the logs I am getting:

https://paste.pythondiscord.com/gobelefuyu

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.