{% load static %} Django RSGI Example

🚀 Django RSGI Example

Simple file serving, video streaming, and real-time updates via django-rsgi

⏰ Server Time

--:--:--
Disconnected

🎯 What This Demonstrates

📁 Static File Serving

CSS and JavaScript files are served using django-rsgi's static file handler in development, which uses Django's staticfiles finders and FileResponse optimization for zero-copy serving. In production, once assets are collected via collectstatic, Granian serves them directly from the filesystem, eliminating the need for a separate static HTTP server like nginx for most applications.

📁 Media File Serving

Media files are served using django-rsgi's optimized file serving with zero-copy transfers, ETag support, and HTTP range requests. This is fast enough to use in production without a separate web server like nginx.

🔄 Async Views

The server time above updates in real-time using an async Django view that streams data via Server-Sent Events (SSE). With Django async views and Granian a single worker can handle thousands of concurrent connections.

⚡ RSGI Protocol

This page is served through the RSGI protocol via Granian, providing efficient Python-Rust integration for high-performance web serving.

📹 Video Gallery - Range Request Support

Videos demonstrate HTTP range request support. When you seek in a video, only the requested portion is served, enabling efficient video streaming through django-rsgi's FileResponse optimization.

{% for video in videos %}

{{ video.name }}

Uploaded: {{ video.uploaded_at|date:"M j, Y" }} - Try seeking to different positions to see range requests in action!

{% empty %}

No videos found. Run migrations and load fixtures to see demo videos.

{% endfor %}

Want to add more videos? Visit the admin interface to upload additional videos and see them appear here automatically.

Login: admin / admin123