-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathasgi.py
More file actions
29 lines (23 loc) · 779 Bytes
/
asgi.py
File metadata and controls
29 lines (23 loc) · 779 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
"""
ASGI config for MirMachineWebapp project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/asgi/
"""
from django.core.asgi import get_asgi_application
import os
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'MirMachineWebapp.settings')
django_asgi_application = get_asgi_application()
from channels.routing import ProtocolTypeRouter, URLRouter
from channels.auth import AuthMiddlewareStack
import lookupService.urls
import django
django.setup()
application = ProtocolTypeRouter({
'http': django_asgi_application,
'websocket': AuthMiddlewareStack(
URLRouter(
lookupService.urls.websocket_patterns
)
)
})