Files
demo-alarms/alerts/views.py
Andros Fenollosa 23ac15664e Initial commit: Django LiveView alert system
Real-time alert system using Django LiveView with WebSocket support.
Features include:
- Real-time alert creation, viewing, and deletion
- Broadcast notifications to all connected users
- SQLite database
- Stimulus.js integration for interactive UI
- Modal dialogs for alert details
- Alert form with validation

Fixed Stimulus controller scope issue by placing data-controller on html element.
2025-12-08 12:27:58 +01:00

8 lines
185 B
Python

from django.shortcuts import render
from .models import Alert
def index(request):
alerts = Alert.objects.all()
return render(request, 'alerts/index.html', {'alerts': alerts})