@notify_on_save — Postgres LISTEN/NOTIFY → UI

A model save reaches every connected reader's open page in ~50 ms. No Celery. No Redis pub/sub. No second service to operate.

Heads up: you're on SQLite. @notify_on_save is a Postgres feature — the model saves still work, but the broadcast layer is inactive in this demo. Configure DATABASE_URL=postgres://… to see live updates across browser tabs.

Order feed (14 total)

listening

On Postgres, this would fan out to every open browser tab via NOTIFY realtime_order. Configure Postgres to try it.

#CustomerTotalStatusTime
14Globex Field Ops$199.00pending22:43:11
13Globex Lab$149.00pending22:43:11
12Globex Tower$99.00pending22:43:11
11Acme East$199.00pending22:43:11
10Acme West$149.00pending22:43:11
9Acme HQ$99.00pending22:43:11
8Tyrell Corp$159.92shipped22:41:40
7Cyberdyne$139.93pending22:41:40
6Stark Industries$119.94cancelled22:41:40
5Wayne Ent.$99.95shipped22:41:40

The whole pattern

Model

from djust.db import notify_on_save

@notify_on_save("realtime_order")
class Order(models.Model):
    customer = models.CharField(max_length=200)
    total = models.DecimalField(max_digits=10, decimal_places=2)

View

class OrderFeed(LiveView):
    def mount(self, request, **kwargs):
        self.listen("realtime_order")
        self._refresh()

    def handle_info(self, message):
        if message["type"] == "db_notify":
            self._refresh()  # picks up the new save

See docs.djust.org/api/notify-on-save/ for the full guide including channel naming, signal teardown, and async listeners.