File: routing.py

package info (click to toggle)
sentry-python 2.22.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,268 kB
  • sloc: python: 58,847; sh: 126; makefile: 114; xml: 2
file content (18 lines) | stat: -rw-r--r-- 494 bytes parent folder | download | duplicates (2)
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})