Skip to content

Commit

Permalink
Setup ASGI config
Browse files Browse the repository at this point in the history
See also: #17
  • Loading branch information
BECATRUE committed Nov 22, 2024
1 parent 6074335 commit 8fa55de
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion wlm_server/wlm_server/asgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,19 @@
import os

from django.core.asgi import get_asgi_application
from channels.auth import AuthMiddlewareStack
from channels.routing import ProtocolTypeRouter, URLRouter
from channels.security.websocket import AllowedHostsOriginValidator

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'wlm_server.settings')

application = get_asgi_application()
application = ProtocolTypeRouter(
{
'http': get_asgi_application(),
'websocket': AllowedHostsOriginValidator(
AuthMiddlewareStack(
URLRouter([])
)
),
}
)

0 comments on commit 8fa55de

Please sign in to comment.