'Error 500 on Websocket, deploying Django-app on Heroku
I'm having some problems with websockets that I don't have locally. The problem is that heroku is telling me that there is a 500 error.
My settings on prod:
ASGI_APPLICATION = 'config.asgi.application'
CHANNEL_LAYERS = {
"default": {
"BACKEND": "channels_redis.core.RedisChannelLayer",
"CONFIG": {
"hosts": [("redis_url")]
},
},
}
My ASGI.py
import django
from channels.auth import AuthMiddlewareStack
from channels.routing import ProtocolTypeRouter, URLRouter
from django.core.asgi import get_asgi_application
from my_app.chat import (
routing,
)
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "my_app.settings")
django.setup()
application = ProtocolTypeRouter({
"http": get_asgi_application(),
"websocket": AuthMiddlewareStack(
URLRouter(
routing.websocket_urlpatterns
)
),
})
I'm ready using wss instead of ws, and that not the problem.
Thanks!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
