push_to_view() — webhooks → UI in ~50 ms

Any sync context (Celery task, Stripe webhook, Django signal, cron job) can push state into a connected LiveView. No request cycle, no polling.

Activity log

push_to_view

Click the button to simulate an external system (a Celery task, a Stripe webhook, etc.) calling push_to_view() against this view.

  • No activity yet.

The whole pattern

from djust.push import push_to_view

# Fired from a Celery task, webhook, signal, cron job — anywhere.
@shared_task
def order_shipped_webhook(order_id, tracking):
    push_to_view(
        'apps.dashboard.views.DashboardView',
        handler='external_event',
        payload={'kind': 'order_shipped',
                 'order_id': order_id,
                 'tracking': tracking},
    )

See docs.djust.org/api/push/ for the full API including state=, handler=, and async variants.