Using django channels to build real time applications

Table of Contents Introduction Main Concepts asgi Websockets Channel Implementation Chat Testing Final Thoughts This tutorial is for django developers who are comfortable with the primitives and want to build real time applications using django + channels. We’ll be building a minimal intercom clone(backend only) to simulate chat support provided to client websites who embed our widget for website visitors as illustrated Introduction Real time systems differ from traditional systems by the constraint of response time - typically they need to respond to changes in state immediately or within a guaranteed time frame, often dictated by the system’s operation requirements. Unlike traditional request-response systems, real time systems prioritise timely and predictable execution, often at the expense of throughput or flexibility. For ex in a ticket booking website like Ticketmaster, the typical request-response flow comprises of fetching all the available tickets for the user’s search criteria, booking them etc, all of which can tolerate brief delays. Contrast it with a real time system like a trading app where trades have to be executed immediately as soon as a request is made and execution time is a governing factor in the quality and success of this service. ...

April 15, 2025 · 13 min · Navdeep Saini

Command line tools for the productive web developer

In my previous post, I discussed some general purpose command line utilities that help ease your way around the command line. In this post we’ll discuss some command line utilities that are indispensable to my web development workflow, and might come in handy for you too :) pgcli/mycli All web apps depend on a database of some kind. Thus, communicating with a database is one of the most common tasks a web developer has to perform. Although MySQL and PostgreSQL come bundled with their own CLI tools, there are options like pgcli/mycli which provide more powerful interfaces to the same databases, with features like auto completion, command history, syntax highlighting and many more. ...

December 29, 2022 · 2 min · Navdeep Saini