Skip to content

Commit

Permalink
Add url pattern for OperationConsumer
Browse files Browse the repository at this point in the history
See also: #17
  • Loading branch information
BECATRUE committed Dec 3, 2024
1 parent 335871e commit 8c0b49d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion wlm_server/wlm_server/asgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,24 @@
import os

from django.core.asgi import get_asgi_application
from django.urls import path
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')

# pylint: disable=wrong-import-position
from operation.consumers import OperationConsumer

application = ProtocolTypeRouter(
{
'http': get_asgi_application(),
'websocket': AllowedHostsOriginValidator(
AuthMiddlewareStack(
URLRouter([])
URLRouter([
path('ws/operation/<int:ch>/', OperationConsumer.as_asgi()),
])
)
),
}
Expand Down

0 comments on commit 8c0b49d

Please sign in to comment.