asgi.py 619 B

12345678910111213141516171819202122232425262728
  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. import os
  8. from archivebox.config import setup_django
  9. setup_django(in_memory_db=False, check_db=True)
  10. from django.core.asgi import get_asgi_application
  11. from channels.routing import ProtocolTypeRouter
  12. django_asgi_app = get_asgi_application()
  13. application = ProtocolTypeRouter(
  14. {
  15. "http": django_asgi_app,
  16. # Just HTTP for now. (We can add other protocols later.)
  17. }
  18. )