Re: separate http requests between channels routing and "classic django routing

2018-03-14 Thread Andrew Godwin
Ah, yes, there is a bug with URLRouter and path() where it will auto-add a $ to the regex it generates as it doesn't think the right-hand side is an include. This is likely something I need to patch in Django itself, but until then I suggest using re_path in any case where you want to match just a

Re: separate http requests between channels routing and "classic django routing

2018-03-14 Thread Kevin Tewouda
Thanks Andrew i found the mistake myself, my routing file was like this http_urlpatterns = [ path('stream', ServerSentEventsConsumer), path('', AsgiHandler) ] I think that the second route will match all the default routes, but like it is mentionned in the tutorial, we have to use a *re

Re: separate http requests between channels routing and "classic django routing

2018-03-13 Thread Andrew Godwin
You can just use channels.http.AsgiHandler as the consumer/ASGI app to hand off to Django views. It's mentioned in the last paragraph here: http://channels.readthedocs.io/en/latest/topics/routing.html#protocoltyperouter Andrew On Tue, Mar 13, 2018 at 9:20 AM, Kevin Tewouda wrote: > Hello, > i a

separate http requests between channels routing and "classic django routing

2018-03-13 Thread Kevin Tewouda
Hello, i am developing an application (a REST one) which have to serve some sse events to a web application. I saw in the latest documentation how to create an SSE consumer, but now when i create an http routing for consumers, i can't serve the others requests using the "classic django view sy