asgi.py 917 B

123456789101112131415161718192021222324252627282930313233
  1. """
  2. WSGI config for archivebox project.
  3. It exposes the WSGI callable as a module-level variable named ``application``.
  4. For more information on this file, see
  5. https://docs.djangoproject.com/en/2.1/howto/deployment/wsgi/
  6. """
  7. from archivebox.config.django import setup_django
  8. setup_django(in_memory_db=False, check_db=True)
  9. # from channels.auth import AuthMiddlewareStack
  10. # from channels.security.websocket import AllowedHostsOriginValidator
  11. from channels.routing import ProtocolTypeRouter # , URLRouter
  12. from django.core.asgi import get_asgi_application
  13. # from core.routing import websocket_urlpatterns
  14. django_asgi_app = get_asgi_application()
  15. application = ProtocolTypeRouter(
  16. {
  17. "http": django_asgi_app,
  18. # only if we need websocket support later:
  19. # "websocket": AllowedHostsOriginValidator(
  20. # AuthMiddlewareStack(URLRouter(websocket_urlpatterns))
  21. # ),
  22. }
  23. )