Django Channels

55 views
Skip to first unread message

Amirtpal

unread,
Oct 16, 2016, 12:43:36 PM10/16/16
to Django users
Hi Django folks,

Just a couple of questions on using Django Channels

a) Assuming I have remote and distributed clients(e.g. custom code deployed inside web applications) and I need that to maintain an asynch flow over https to our backend django server in the cloud,
how could I use Django Channels for this above use case ?
b) If these clients are running inside web applications behind a firewall and the only outbound communication is over 80 and 443 via https would websockets still work ?
c) Is there a concept of a producer and consumer in django channels ?
d) Any sample code that could be included in remote web applications in order to to enable them to communicate in real time via asyn flow with a cloud hosted django server ?

Thanks and appreciate your reply.

-Amirtpal

Andrew Godwin

unread,
Oct 16, 2016, 1:27:53 PM10/16/16
to Django users
Hi Amirtpal,

a) You would use WebSockets for this purpose. I can't give a summary of how they work here - there's plenty of documentation out there about them - but they tunnel over HTTP(S) and provide bidirectional communication.

b) If the firewall is just limiting ports, then yes. If there's a weird proxy that's capturing all traffic and redirecting it, though, it may block WebSockets.

c) I'm not sure what sort of producer and consumer you're talking about, but if you read the documentation you'll see that we call the code that handles messages on channels consumers. Producer makes no sense as a standalone as it's a bidirectional thing not a work queue.

d) There are some examples at https://github.com/andrewgodwin/channels-examples, but they're not something you can just drop into production; channels is a framework for you to build an application on top of, you'll have to write your own Python and Javascript around it.

Andrew

Amirtpal

unread,
Oct 16, 2016, 9:55:46 PM10/16/16
to Django users
Thanks Andrew,

-Amirtpal
Reply all
Reply to author
Forward
0 new messages