Framework Comparison
How djust compares to Phoenix LiveView, Laravel Livewire, and HTMX. Make an informed decision for your next project.
At a Glance
| Feature | djust | LiveView | Livewire | HTMX |
|---|---|---|---|---|
| Language | Python | Elixir | PHP | Any |
| Framework | Django | Phoenix | Laravel | N/A |
| VDOM Engine | [Object] | [Object] | [Object] | [Object] |
| Client Bundle Size | ~29 KB | ~30 KB | ~50 KB | ~14 KB |
| Rendering Speed | 0.8ms | ~1-2ms | ~5-10ms | N/A |
| VDOM Diff Speed | <100μs | ~200μs | ~500μs | N/A |
| WebSocket Required | [Object] | [Object] | [Object] | [Object] |
| Form Integration | [Object] | [Object] | [Object] | [Object] |
| Component System | [Object] | [Object] | [Object] | [Object] |
| State Management | [Object] | [Object] | [Object] | [Object] |
| LLM/AI Streaming | [Object] | [Object] | [Object] | [Object] |
| Presence Tracking | [Object] | [Object] | [Object] | [Object] |
| Server Push | [Object] | [Object] | [Object] | [Object] |
| JS Hooks/Lifecycle | [Object] | [Object] | [Object] | [Object] |
| File Upload | [Object] | [Object] | [Object] | [Object] |
| Multi-Tenant | [Object] | [Object] | [Object] | [Object] |
| PWA/Offline | [Object] | [Object] | [Object] | [Object] |
Code Comparison: Counter Example
djust (Python)
from djust import LiveView
class CounterView(LiveView):
template_string = """
<div>
<h1>{{ count }}</h1>
<button dj-click="increment">+</button>
</div>
"""
def mount(self, request):
self.count = 0
def increment(self):
self.count += 1
Phoenix LiveView (Elixir)
defmodule CounterLive do
use Phoenix.LiveView
def render(assigns) do
~H"""
<div>
<h1><%= @count %></h1>
<button phx-click="increment">+</button>
</div>
"""
end
def mount(_params, _session, socket) do
{:ok, assign(socket, count: 0)}
end
def handle_event("increment", _, socket) do
{:noreply, assign(socket, count: socket.assigns.count + 1)}
end
end
Laravel Livewire (PHP)
namespace App\Livewire;
use Livewire\Component;
class Counter extends Component
{
public $count = 0;
public function increment()
{
$this->count++;
}
public function render()
{
return view('livewire.counter');
}
}
// resources/views/livewire/counter.blade.php
<div>
<h1>{{ $count }}</h1>
<button wire:click="increment">+</button>
</div>
HTMX (Any Backend)
# Backend (any language)
@app.route("/counter")
def counter():
count = session.get('count', 0)
return render_template('counter.html', count=count)
@app.route("/increment", methods=['POST'])
def increment():
count = session.get('count', 0) + 1
session['count'] = count
return f'<h1>{count}</h1>'
<!-- Template -->
<div>
<h1 id="count">{{ count }}</h1>
<button hx-post="/increment"
hx-target="#count"
hx-swap="outerHTML">+</button>
</div>
vs Phoenix LiveView
When to choose djust:
- ✓ You're already using Django/Python
- ✓ You need the fastest VDOM diffing (Rust)
- ✓ You want a lightweight client bundle (~29KB gzipped)
- ✓ You prefer Python decorators over Elixir syntax
- ✓ You need Django ORM integration
- ✓ Built-in LLM streaming support (StreamingMixin)
- ✓ Multi-tenant SaaS support (TenantMixin)
When to choose Phoenix LiveView:
- • You're already using Phoenix/Elixir
- • You need proven scalability (>2M connections)
- • You prefer functional programming
- • You value ecosystem maturity (2019 release)
vs Laravel Livewire
When to choose djust:
- ✓ 10x faster rendering (Rust vs PHP)
- ✓ Smaller bundle (~29KB vs ~50KB)
- ✓ Real-time WebSocket support (optional)
- ✓ Sub-millisecond VDOM diffing
- ✓ You prefer Python over PHP
- ✓ Built-in presence tracking and live cursors
- ✓ Server push from background tasks (push_to_view)
When to choose Laravel Livewire:
- • You're already using Laravel/PHP
- • You prefer HTTP polling over WebSockets
- • You value large ecosystem (2019 release)
- • You need mature UI component libraries
vs HTMX
When to choose djust:
- ✓ You need stateful components
- ✓ You want automatic VDOM diffing
- ✓ You need real-time WebSocket updates
- ✓ You want form integration (Django Forms)
- ✓ You prefer less manual wiring
- ✓ Built-in file uploads with chunked WebSocket transfer
- ✓ Progressive Web App support (PWAMixin)
When to choose HTMX:
- • You want framework-agnostic approach
- • You prefer explicit HTML attributes
- • You don't need stateful components
- • You want to enhance existing HTML
- • You value simplicity over features
Performance Summary
* Benchmarks based on 10,000 renders of a typical dashboard template
Migration Guides
From Phoenix LiveView
Learn how to migrate your LiveView app to djust. Map concepts, adapt patterns, and deploy.
Read Guide →From Laravel Livewire
Port your Livewire components to djust. Similar concepts, better performance.
Read Guide →From HTMX
Upgrade from HTMX to djust for stateful components and automatic diffing.
Read Guide →Ready to Try djust?
Experience the performance and developer experience of djust. Explore examples or install locally.