Django LiveView
Build real-time, reactive interfaces with Django using WebSockets β write Python, not JavaScript

What is HTML over the Wire?
HTML over the Wire, or HTML over WebSockets, is a strategy for creating real-time SPAs by establishing a WebSocket connection between a client and server. It allows JavaScript to request actionsβits only responsibility is to handle eventsβwhile the backend handles the business logic and renders HTML. This means you can create dynamic pages without reloading, without AJAX or APIs. This technology provides a secure, stable, and low-latency connection for real-time web applications.


What is Django LiveView? π
Django LiveView is a framework for creating real-time, interactive web applications entirely in Python π, inspired by Phoenix LiveView and Laravel Livewire. It is built on top of Django Channels.
Build rich, dynamic user experiences β¨ with server-rendered HTML without writing a single line of JavaScript. Perfect for Django developers who want real-time features β‘ without the complexity of a separate frontend framework.
Let's illustrate with an example. I want to print article number 2.
A WebSocket connection (a channel) is established between the client and the server.
JavaScript sends a message via WebSocket to the server (Django).

Django interprets the message and renders the HTML of the article through the template system and the database.
Django sends the HTML to JavaScript via the channel and specifies which selector to embed it in.

JavaScript renders the received HTML in the indicated selector.

The same process is repeated for each action, such as clicking a button, submitting a form, etc.
What are your superpowers? πͺ
π― Create SPAs without using APIs β No REST or GraphQL needed
π¨ Uses Django's template system to render the frontend (without JavaScript frameworks)
π Logic stays in Python β No split between backend and frontend
π οΈ Use all of Django's tools β ORM, forms, authentication, admin, etc.
β‘ Everything is asynchronous by default β Built on Django Channels
π Zero learning curve β If you know Python and Django, you're ready
π Real-time by design β All interactions happen over WebSockets
π Batteries included β JavaScript assets bundled, automatic reconnection with exponential backoff
π‘ Type hints and modern Python (3.10+)
π‘ Broadcast support for multi-user real-time updates
π Middleware system for authentication and authorization
Are you ready to create your first real-time SPA? Let's go to the Tutorial.