Save 37% off PRO during our Black Friday Sale! »

Real Time Web with Django Channels

Real Time Web with Django Channels

The talk will introduces the Channels concept, explains how they work and shows a few examples of what’s now possible (or plain easier) to do with them.

382b18eebb1386e80ff7e20fd1eb784e?s=128

Senko Rašić

November 08, 2016
Tweet

Transcript

  1. Real Time Web With Django Channels Senko Rašić senko.rasic@goodcode.io

  2. JOIN ME, AND TOGETHER WE WILL RULE THE GALAXY

  3. WSGI

  4. socket.io bro!

  5. None
  6. Andrew Godwin

  7. Django Channels + ASGI

  8. Gunicorn uWSGI Django request response WSGI request response HTTP

  9. Daphne Django message message ASGI request response HTTP

  10. Daphne Django message message ASGI WSS upgrade WS frame HTTP

    WS frame WS frame WS frame message message message disconnect message
  11. Daphne Django message message ASGI WSS upgrade WS frame HTTP

    WS frame WS frame WS frame message message message disconnect message Django Django Django Django Django
  12. Daphne Django worker ASGI HTTP redis Django worker Django worker

  13. Daphne Django worker ASGI HTTP redis Django worker Django worker

    Daphne HTTP
  14. Interface Server Worker server ASGI HTTP Channel Layer Worker server

    Worker server Interface Server HTTP ASGI ASGI ASGI ASGI
  15. Interface Server Consumer (View) HTTP GET ASGI http.request Interface Server

    HTTP response ASGI http.response!abc HTTP request handling
  16. Interface Server Consumer WS socket ASGI websocket.receive Interface Server WS

    socket1 ASGI websocket.send!abc WebSockets handling Interface Server WS socket2 ASGI websocket.send!def
  17. View Consumer ASGI ASGI jobqueue Consumer Consumer ASGI ASGI Bonus:

    task queue ASGI
  18. DEMO TIME!

  19. That’s all, Folks! See also: Reinventing Django for the Real-Time

    Web https://www.youtube.com/watch?v=2sEPipctTxw
  20. Image credits: Darth Vader - https://www.pinterest.com/jaclynnpetersen/star-wars/ Trabant - https://en.wikipedia.org/wiki/Trabant Rube

    Goldberg Machine - https://en.wikipedia.org/wiki/Rube_Goldberg_machine Meditating Monk - https://www.flickr.com/photos/aigle_dore/24065839299 Flying DeLorean - http://mugen.wikia.com/wiki/Delorean