You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
616 B
31 lines
616 B
import os
|
|
|
|
import django
|
|
|
|
|
|
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'acapp.settings')
|
|
|
|
django.setup()
|
|
|
|
from channels.auth import AuthMiddlewareStack
|
|
from channels.routing import ProtocolTypeRouter, URLRouter
|
|
from django.core.asgi import get_asgi_application
|
|
from game.routing import websocket_urlpatterns
|
|
|
|
|
|
from channels.layers import get_channel_layer
|
|
|
|
from game.channelsmiddleware import JwtAuthMiddlewareStack
|
|
|
|
|
|
channel_layer = get_channel_layer()
|
|
|
|
|
|
|
|
|
|
|
|
application = ProtocolTypeRouter({
|
|
"http": get_asgi_application(),
|
|
"websocket": JwtAuthMiddlewareStack(URLRouter(websocket_urlpatterns))
|
|
})
|