You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

routing.py 515B

1234567891011121314151617181920212223
  1. from channels.routing import ProtocolTypeRouter, URLRouter
  2. from django.urls import re_path
  3. from channels.routing import URLRouter
  4. from channels.http import AsgiHandler
  5. from channels.auth import AuthMiddlewareStack
  6. import django_eventstream
  7. urpatterns = [
  8. re_path(r'events/',
  9. AuthMiddlewareStack(URLRouter(django_eventstream.routing.urlpatterns)),
  10. {'channels': ['notice']}),
  11. re_path(r'', AsgiHandler),
  12. ]
  13. application = ProtocolTypeRouter({
  14. 'http' : URLRouter(urpatterns)
  15. })