{% extends "base.html" %} {% load components %} {% block title %}WebSocket Demo - Component Framework{% endblock %} {% block content %}

Real-Time WebSocket Updates

Open this page in multiple browser windows and watch them sync in real-time!

Features:

{% live_component "live_counter" initial=0 broadcast=True %}

Try it:

  1. Open this page in another browser window
  2. Click the + or - buttons in one window
  3. Watch the counter update in both windows instantly!

Architecture:

Client clicks button
    ↓
Component handles event
    ↓
State updated
    ↓
HTML re-rendered
    ↓
Broadcast via WebSocket
    ↓
All subscribed clients update
    
{% endblock %}