File: routing.py

package info (click to toggle)
sentry-python 2.18.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,004 kB
  • sloc: python: 55,908; makefile: 114; sh: 111; xml: 2
file content (18 lines) | stat: -rw-r--r-- 494 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
import channels
from channels.routing import ProtocolTypeRouter

try:
    from channels.http import AsgiHandler

    if channels.__version__ < "3.0.0":
        django_asgi_app = AsgiHandler
    else:
        django_asgi_app = AsgiHandler()

except ModuleNotFoundError:
    # Since channels 4.0 ASGI handling is done by Django itself
    from django.core.asgi import get_asgi_application

    django_asgi_app = get_asgi_application()

application = ProtocolTypeRouter({"http": django_asgi_app})