[Django Channels] Disable default django HTTP routes
application = ProtocolTypeRouter({
'http': URLRouter([]),
'websocket': URLRouter(
apps.rt.routing.websocket_urlpatterns
)
-- Is there a way to disable django HTTP routes? I've two servers threaded and async, and I want to disable the django routes in the async server. I read the docs, didn't find an answer.
Doing:
'http': URLRouter([]),
'websocket': URLRouter(
apps.rt.routing.websocket_
)
})
Gives me
[2019-02-26 19:13:22 +0000] [7] [ERROR] Exception in ASGI application
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/uvicorn/protocols/http/httptools_impl.py", line 371, in run_asgi
asgi = app(self.scope)
File "/usr/local/lib/python3.7/site-packages/channels/routing.py", line 58, in __call__
return self.application_mapping[scope["type"]](scope)
File "/usr/local/lib/python3.7/site-packages/channels/routing.py", line 154, in __call__
raise ValueError("No route found for path %r." % path)
Traceback (most recent call last):
File "/usr/local/lib/python3.7/
asgi = app(self.scope)
File "/usr/local/lib/python3.7/
return self.application_mapping[
File "/usr/local/lib/python3.7/
raise ValueError("No route found for path %r." % path)
-------
and an internal error
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/557865b4-197b-47d9-b090-4d13c11ed6a6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment