SitePoint
  • Blog
  • Forum
  • Library
  • Login
Join Premium
  1. Details
  2. Creator
  3. Content
  4. Reviews
  5. FAQ
Django Channels for Real-time Updates Cover

Django Channels for Real-time Updates

Created by

Stuart Langridge

Published by

SitePoint

Last Updated

4 December 2019

Details

Channels adds asynchronous events to Django. This has the potential to make Django event-driven—to have things happen in the user’s browser in direct response to something changing. in this tutorial, Stuart modifies Django's tutorial polls app to make so that poll rerults are updated in real time.

Description

Django’s views system provides a perfectly good way to run a website. However, it’s sometimes useful to have real-time updates to data, without the user having to navigate around or refresh a page—for example, if you’ve got a lot of fast-changing content.

The best way to handle this sort of dynamic, real-time data is with Django Channels. Channels adds asynchronous events to Django. When something changes on the server, you can notify the user that that thing changed without waiting for the user to manually check. This has the potential to make Django event-driven—to have things happen in the user’s browser in direct response to something changing. This is great if you want to show a real-time set of updates—new posts, or live chat, or changing vote totals, or activity by other users.

In this tutoruial, we’ll look at a very simple example—Django’s tutorial polls app—but altered to use Channels so that the results for polls are updated dynamically in real time as the user watches.

Creator

Stuart Langridge avatar

Stuart Langridge

Stuart is a consultant CTO, software architect, and developer to startups and small firms on strategy, custom development, and how to best work with the dev team. Code and writings are to be found at kryogenix.org and social networks; Stuart himself is mostly to be found playing D&D or looking for the best vodka Collins in town.
Stuart Langridge avatar

Content

1
Preview

Reviews

Log in to write a review!

Frequently Asked Questions

Django Channels for Real-time Updates Cover

Django Channels for Real-time Updates

  • Unlimited access to this title and 600+ others in our library

  • New titles added frequently

  • Cancel anytime

Stuff we do

  • Premium
  • Newsletters
  • Forums

About

  • Our Story
  • Terms of use
  • Privacy Policy
  • Corporate Memberships

Contact

  • Contact us
  • FAQ
  • Publish your book with us
  • Write an article for us
  • Advertise

Connect

© 2000 – 2024 SitePoint Pty. Ltd.

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.