Feedback & Notification

Notification Center with real-time server push

← Home

Notification Center

Notifications
Your deployment completed successfully.
2m ago
Alice commented on your PR: 'Looks great!'
15m ago
Weekly digest: 3 new components shipped.
1h ago
Scheduled maintenance Sunday 2am–4am UTC.
3h ago

Click the bell icon above. Unread count badge updates in real-time. Clicking a notification marks it as read. Server pushes new notifications.

Your deployment completed successfully. 2m ago
Alice commented on your PR: 'Looks great!' 15m ago
Weekly digest: 3 new components shipped. 1h ago
Scheduled maintenance Sunday 2am–4am UTC. 3h ago

Real-Time Pattern

views.pypython
class DashboardView(LiveView):
    def mount(self, request, **kwargs):
        self.notifications = Notification.objects.filter(
            user=request.user
        ).order_by('-created_at')[:20]

    @event_handler()
    def mark_notification_read(self, value='', **kwargs):
        Notification.objects.filter(
            id=value, user=self.request.user
        ).update(unread=False)

For real-time push from background tasks, use push_to_view() to send updates to connected clients without them polling.

tasks.pypython
# Celery / background task
def notify_user(user_id, message):
    Notification.objects.create(
        user_id=user_id, message=message
    )
    push_to_view(
        user_id=user_id,
        view_class=DashboardView,
        event='refresh_notifications',
    )