您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

asgi.py 908B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. """
  2. ASGI config for djc_srv project.
  3. It exposes the ASGI callable as a module-level variable named ``application``.
  4. For more information on this file, see
  5. https://docs.djangoproject.com/en/4.1/howto/deployment/asgi/
  6. """
  7. import os
  8. from django.core.asgi import get_asgi_application
  9. from channels.auth import AuthMiddlewareStack
  10. from channels.routing import ProtocolTypeRouter, URLRouter
  11. from channels.security.websocket import AllowedHostsOriginValidator
  12. import wsps.routing
  13. os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'djc_srv.settings')
  14. # application = get_asgi_application()
  15. application = ProtocolTypeRouter({
  16. "http": get_asgi_application(),
  17. # Just HTTP for now. (We can add other protocols later.)
  18. "websocket": AllowedHostsOriginValidator(
  19. AuthMiddlewareStack(
  20. URLRouter(
  21. wsps.routing.websocket_urlpatterns
  22. )
  23. )
  24. ),
  25. })