PyCon, the gathering for the community using and developing the open-source Python programming language. This is the first year of the PyCon Pune where the community will meet for two days of talks and working on upstream projects in two days of dev sprint. CFP ends on 30th November AoE.
Realtime django - Channels to rescue
Implementing websockets in django was hard before Django channels
At its core, Django is built around the simple concept of requests and responses: the browser makes a request, Django calls a view, which returns a response that’s sent back to the browser. The view is only around for lifetime of request and there’s no mechanism to hold open a connection or send data down to the client without an associated request.
Earlier there was no standard implementation of websockets built right into django. We were supposed to use external libraries like dragon swarm, pusher etc. There was lot of work involved at developer side just to understand the nitty gritty details of the libraries.
So this is where django-channels came to rescue.
The whole idea of this talk is to know how to build scalable realtime application using websockets in django. For that, We will discuss how django-channels are going to help us in achieveing it.
The talk is going to cover two different “eras” of building realtime applications in django
- Pre “channels” era
- Post “channels” era
- How current request response cycle works in django(without django-channels)
- Why implementing websockets currently is hard
- How easy is to use django-channels to build scalable realtime applications
- A short demo
I am the cofounder of MindIQ. At MindIQ, we use django-channels to push realtime data to our clients used by 1000+ businesses globally.