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 457B

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