quantum-ai-v3/core/error_views.py
Claude 8538b63246 🎨 Create themed error pages matching agent UI design
 New Features:
- Complete redesign of 404, 500, 403, and 400 error pages
- Agent-themed UI with header, navigation, and widget components
- Component-based architecture using agent-base.css styling
- Responsive design with proper error handling

🔧 Technical Improvements:
- Custom error handlers for production (DEBUG=False)
- Proper Django error view integration
- Authentication-aware error pages (403 shows login options)
- Interactive elements (refresh, go back, contact support)

🎯 UI/UX Enhancements:
- Consistent branding with agent ecosystem
- Quick links to popular agents on 404 page
- System status indicators on 500 page
- Troubleshooting steps on 400 page
- Professional error messaging

Error pages now feel integrated with the platform instead of generic Django errors.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-07-26 23:12:56 +05:30

38 lines
1.1 KiB
Python

from django.shortcuts import render
from django.http import HttpResponseNotFound, HttpResponseServerError, HttpResponseForbidden, HttpResponseBadRequest
def custom_404_view(request, exception):
"""Custom 404 error page with agent theme"""
return HttpResponseNotFound(
render(request, '404.html', {
'timestamp': '1.0' # Cache busting for CSS
}).content
)
def custom_500_view(request):
"""Custom 500 error page with agent theme"""
return HttpResponseServerError(
render(request, '500.html', {
'timestamp': '1.0' # Cache busting for CSS
}).content
)
def custom_403_view(request, exception):
"""Custom 403 error page with agent theme"""
return HttpResponseForbidden(
render(request, '403.html', {
'timestamp': '1.0' # Cache busting for CSS
}).content
)
def custom_400_view(request, exception):
"""Custom 400 error page with agent theme"""
return HttpResponseBadRequest(
render(request, '400.html', {
'timestamp': '1.0' # Cache busting for CSS
}).content
)