Skip to main content

Phoenix LiveView-style reactive components for Django with Rust-powered performance. Real-time UI updates over WebSocket, no JavaScript build step required.

Project description

djust

Blazing fast reactive server-side rendering for Django, powered by Rust

djust brings Phoenix LiveView-style reactive components to Django, with performance that feels native. Write server-side Python code with automatic, instant client updatesโ€”no JavaScript bundling, no build step, no complexity.

๐ŸŒ djust.org | ๐Ÿš€ Quick Start | ๐Ÿ“ Examples

PyPI version CI MIT License Python 3.8+ Django 3.2+ PyPI Downloads

โœจ Features

  • โšก 10-100x Faster - Rust-powered template engine and Virtual DOM diffing
  • ๐Ÿ”„ Reactive Components - Phoenix LiveView-style server-side reactivity
  • ๐Ÿ”Œ Django Compatible - Works with existing Django templates and components
  • ๐Ÿ“ฆ Zero Build Step - ~29KB gzipped client JavaScript, no bundling needed
  • ๐ŸŒ WebSocket Updates - Real-time DOM patches over WebSocket (with HTTP fallback)
  • ๐ŸŽฏ Minimal Client Code - Smart diffing sends only what changed
  • ๐Ÿ”’ Type Safe - Rust guarantees for core performance-critical code
  • ๐Ÿž Developer Debug Panel - Interactive debugging with event history and VDOM inspection
  • ๐Ÿ’ค Lazy Hydration - Defer WebSocket connections for below-fold content (20-40% memory savings)
  • ๐Ÿš€ TurboNav Compatible - Works seamlessly with Turbo-style client-side navigation
  • ๐Ÿ“ฑ PWA Support - Offline-first Progressive Web Apps with automatic sync
  • ๐Ÿข Multi-Tenant Ready - Production SaaS architecture with tenant isolation
  • ๐Ÿ” Authentication & Authorization - View-level and handler-level auth with Django permissions integration

๐ŸŽฏ Quick Example

from djust import LiveView, event_handler

class CounterView(LiveView):
    template_string = """
    <div>
        <h1>Count: {{ count }}</h1>
        <button dj-click="increment">+</button>
        <button dj-click="decrement">-</button>
    </div>
    """

    def mount(self, request, **kwargs):
        self.count = 0

    @event_handler
    def increment(self):
        self.count += 1  # Automatically updates client!

    @event_handler
    def decrement(self):
        self.count -= 1

That's it! No JavaScript needed. State changes automatically trigger minimal DOM updates.

๐Ÿ“Š Performance

Benchmarked on M1 MacBook Pro (2021):

Operation Django djust Speedup
Template Rendering (100 items) 2.5 ms 0.15 ms 16.7x
Large List (10k items) 450 ms 12 ms 37.5x
Virtual DOM Diff N/A 0.08 ms Sub-ms
Round-trip Update 50 ms 5 ms 10x

Run benchmarks yourself:

cd benchmarks
python benchmark.py

๐Ÿš€ Installation

Prerequisites

  • Python 3.8+
  • Rust 1.70+ (for building from source)
  • Django 3.2+

Install from PyPI

pip install djust

Build from Source

Using Make (Easiest - Recommended for Development)

# Clone the repository
git clone https://github.com/djust-org/djust.git
cd djust

# Install Rust (if needed)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# Install everything and build
make install

# Start the development server
make start

# See all available commands
make help

Common Make Commands:

  • make start - Start development server with hot reload
  • make stop - Stop the development server
  • make status - Check if server is running
  • make test - Run all tests
  • make clean - Clean build artifacts
  • make help - Show all available commands

Using uv (Fast)

# Clone the repository
git clone https://github.com/djust-org/djust.git
cd djust

# Install Rust (if needed)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# Install uv (if needed)
curl -LsSf https://astral.sh/uv/install.sh | sh

# Create virtual environment and install dependencies
uv venv
source .venv/bin/activate  # On Windows: .venv\Scripts\activate

# Install maturin and build
uv pip install maturin
maturin develop --release

Using pip

# Clone the repository
git clone https://github.com/djust-org/djust.git
cd djust

# Install Rust (if needed)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install maturin
pip install maturin

# Build and install
maturin develop --release

# Or build wheel
maturin build --release
pip install target/wheels/djust-*.whl

๐Ÿ“– Documentation

Setup

  1. Add to INSTALLED_APPS:
INSTALLED_APPS = [
    # ...
    'channels',  # Required for WebSocket support
    'djust',
    # ...
]
  1. Configure ASGI application (asgi.py):
import os
from django.core.asgi import get_asgi_application
from channels.routing import ProtocolTypeRouter, URLRouter
from channels.auth import AuthMiddlewareStack
from djust.websocket import LiveViewConsumer
from django.urls import path

os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myproject.settings')

application = ProtocolTypeRouter({
    "http": get_asgi_application(),
    "websocket": AuthMiddlewareStack(
        URLRouter([
            path('ws/live/', LiveViewConsumer.as_asgi()),
        ])
    ),
})
  1. Add to settings.py:
ASGI_APPLICATION = 'myproject.asgi.application'

CHANNEL_LAYERS = {
    'default': {
        'BACKEND': 'channels.layers.InMemoryChannelLayer'
    }
}

Creating LiveViews

Class-Based LiveView

from djust import LiveView, event_handler

class TodoListView(LiveView):
    template_name = 'todos.html'  # Or use template_string

    def mount(self, request, **kwargs):
        """Called when view is first loaded"""
        self.todos = []

    @event_handler
    def add_todo(self, text):
        """Event handler - called from client"""
        self.todos.append({'text': text, 'done': False})

    @event_handler
    def toggle_todo(self, index):
        self.todos[index]['done'] = not self.todos[index]['done']

Function-Based LiveView

from djust import live_view

@live_view(template_name='counter.html')
def counter_view(request):
    count = 0

    def increment():
        nonlocal count
        count += 1

    return locals()  # Returns all local variables as context

Template Syntax

djust supports Django template syntax with event binding:

<!-- Variables -->
<h1>{{ title }}</h1>

<!-- Filters (all 57 Django built-in filters supported) -->
<p>{{ text|upper }}</p>
<p>{{ description|truncatewords:20 }}</p>
<a href="?q={{ query|urlencode }}">Search</a>
{{ body|urlize|safe }}

<!-- Control flow -->
{% if show %}
    <div>Visible</div>
{% endif %}

{% if count > 10 %}
    <div>Many items!</div>
{% endif %}

{% for item in items %}
    <li>{{ item }}</li>
{% endfor %}

<!-- URL resolution -->
<a href="{% url 'myapp:detail' pk=item.id %}">View</a>

<!-- Template includes -->
{% include "partials/header.html" %}

<!-- Event binding -->
<button dj-click="increment">Click me</button>
<input dj-input="on_search" type="text" />
<form dj-submit="submit_form">
    <input name="email" />
    <button type="submit">Submit</button>
</form>

Supported Events

  • dj-click - Click events
  • dj-input - Input events (passes value)
  • dj-change - Change events (passes value)
  • dj-submit - Form submission (passes form data as dict)

Reusable Components

djust provides a powerful component system with automatic state management and stable component IDs.

Basic Component Example

from djust.components import AlertComponent

class MyView(LiveView):
    def mount(self, request):
        # Components get automatic IDs based on attribute names
        self.alert_success = AlertComponent(
            message="Operation successful!",
            type="success",
            dismissible=True
        )
        # component_id automatically becomes "alert_success"

Component ID Management

Components automatically receive a stable component_id based on their attribute name in your view. This eliminates manual ID management:

# When you write:
self.alert_success = AlertComponent(message="Success!")

# The framework automatically:
# 1. Sets component.component_id = "alert_success"
# 2. Persists this ID across renders and events
# 3. Uses it in HTML: data-component-id="alert_success"
# 4. Routes events back to the correct component

Why it works:

  • The attribute name (alert_success) is already unique within your view
  • It's stable across re-renders and WebSocket reconnections
  • Event handlers can reference components by their attribute names
  • No manual ID strings to keep in sync

Event Routing Example:

class MyView(LiveView):
    def mount(self, request):
        self.alert_warning = AlertComponent(
            message="Warning message",
            dismissible=True
        )

    @event_handler
    def dismiss(self, component_id: str = None):
        """Handle dismissal - automatically routes to correct component"""
        if component_id and hasattr(self, component_id):
            component = getattr(self, component_id)
            if hasattr(component, 'dismiss'):
                component.dismiss()  # component_id="alert_warning"

When the dismiss button is clicked, the client sends component_id="alert_warning", and the handler uses getattr(self, "alert_warning") to find the component.

Creating Custom Components

from djust import Component, register_component, event_handler

@register_component('my-button')
class Button(Component):
    template = '<button dj-click="on_click">{{ label }}</button>'

    def __init__(self, label="Click"):
        super().__init__()
        self.label = label
        self.clicks = 0

    @event_handler
    def on_click(self):
        self.clicks += 1
        print(f"Clicked {self.clicks} times!")

Decorators

from djust import LiveView, event_handler, reactive

class MyView(LiveView):
    @event_handler
    def handle_click(self):
        """Marks method as event handler"""
        pass

    @reactive
    def count(self):
        """Reactive property - auto-triggers updates"""
        return self._count

    @count.setter
    def count(self, value):
        self._count = value

Configuration

Configure djust in your Django settings.py:

LIVEVIEW_CONFIG = {
    # Transport mode
    'use_websocket': True,  # Set to False for HTTP-only mode (no WebSocket dependency)

    # Debug settings
    'debug_vdom': False,  # Enable detailed VDOM patch logging (for troubleshooting)

    # Serialization (issue #292)
    'strict_serialization': False,  # Raise TypeError for non-serializable state values (recommended in development)

    # CSS Framework
    'css_framework': 'bootstrap5',  # Options: 'bootstrap5', 'tailwind', None
}

Common Configuration Options:

Option Default Description
use_websocket True Use WebSocket transport (requires Django Channels)
debug_vdom False Enable detailed VDOM debugging logs
strict_serialization False Raise TypeError for non-serializable state (recommended in dev)
css_framework 'bootstrap5' CSS framework for components

CSS Framework Setup:

For Tailwind CSS (recommended), use the one-command setup:

python manage.py djust_setup_css tailwind

This auto-detects template directories, creates config files, and builds your CSS. For production:

python manage.py djust_setup_css tailwind --minify

See the CSS Framework Guide for detailed setup instructions, Bootstrap configuration, and CI/CD integration.

Debug Mode:

When troubleshooting VDOM issues, enable debug logging:

# In settings.py
LIVEVIEW_CONFIG = {
    'debug_vdom': True,
}

# Or programmatically
from djust.config import config
config.set('debug_vdom', True)

This will log:

  • Server-side: Patch generation details (stderr)
  • Client-side: Patch application and DOM traversal (browser console)

State Management

djust provides Python-only state management decorators that eliminate the need for manual JavaScript.

๐Ÿš€ Quick Start (5 minutes)

Build a debounced search in 8 lines of Python (no JavaScript):

from djust import LiveView
from djust.decorators import debounce

class ProductSearchView(LiveView):
    template_string = """
    <input dj-input="search" placeholder="Search products..." />
    <div>{% for p in results %}<div>{{ p.name }}</div>{% endfor %}</div>
    """

    def mount(self, request):
        self.results = []

    @debounce(wait=0.5)  # Wait 500ms after typing stops
    def search(self, query: str = "", **kwargs):
        self.results = Product.objects.filter(name__icontains=query)[:10]

That's it! Server only queries after you stop typing. Add @optimistic for instant UI updates, @cache(ttl=300) to cache responses for 5 minutes.

๐Ÿ‘‰ Full Quick Start Guide (5 min)


Key Features

  • โœ… Zero JavaScript Required - Common patterns work without writing any JS
  • โœ… 87% Code Reduction - Decorators replace hundreds of lines of manual JavaScript
  • โœ… Lightweight Bundle - ~29KB gzipped client.js (vs Livewire ~50KB)
  • โœ… Competitive DX - Matches Phoenix LiveView and Laravel Livewire developer experience

Available Decorators

Decorator Use When Example
@debounce(wait) User is typing Search, autosave
@throttle(interval) Rapid events Scroll, resize
@optimistic Instant feedback Counter, toggle
@cache(ttl, key_params) Repeated queries Autocomplete
@client_state(keys) Multi-component Dashboard filters
@background Long operations AI generation, file processing
DraftModeMixin Auto-save forms Contact form

Quick Decision Matrix:

  • Typing in input? โ†’ @debounce(0.5)
  • Scrolling/resizing? โ†’ @throttle(0.1)
  • Need instant UI update? โ†’ @optimistic
  • Same query multiple times? โ†’ @cache(ttl)
  • Multiple components? โ†’ @client_state([keys])
  • Long-running work? โ†’ @background or self.start_async(callback)
  • Auto-save forms? โ†’ DraftModeMixin

Learn More

๐Ÿงญ Navigation Patterns

djust provides three navigation mechanisms for building multi-view applications without full page reloads:

When to Use What

Scenario Use Why
Filter/sort/paginate within same view dj-patch / live_patch() No remount, URL stays bookmarkable
Navigate to a different LiveView dj-navigate / live_redirect() Same WebSocket, no page reload
Link to non-LiveView page Standard <a href> Full page load needed

Quick Decision Tree

Use this flowchart when choosing a navigation method:

Is this a direct user click on a link?
โ”œโ”€ Yes โ†’ Is it the same view (filter/sort)?
โ”‚   โ”œโ”€ Yes โ†’ Use dj-patch
โ”‚   โ””โ”€ No โ†’ Use dj-navigate
โ”‚
โ””โ”€ No โ†’ Is navigation conditional on server logic?
    โ”œโ”€ Yes โ†’ Use live_redirect() in @event_handler
    โ”‚   Examples: form validation, auth checks, async operations
    โ””โ”€ No โ†’ You probably need dj-navigate (see anti-pattern below)

โš ๏ธ Anti-Pattern: Don't Use dj-click for Navigation

This is the most common mistake when building multi-view djust apps. Using dj-click to trigger a handler that immediately calls live_redirect() creates an unnecessary round-trip.

โŒ Wrong โ€” using dj-click to trigger a handler that calls live_redirect():

# Anti-pattern: Handler does nothing but navigate
@event_handler()
def go_to_item(self, item_id, **kwargs):
    self.live_redirect(f"/items/{item_id}/")  # Wasteful round-trip!
<!-- Wrong: Forces WebSocket round-trip just to navigate -->
<button dj-click="go_to_item" dj-value-item_id="{{ item.id }}">View</button>

What actually happens:

  1. User clicks button โ†’ Client sends WebSocket message (50-100ms)
  2. Server receives message, processes handler (10-50ms)
  3. Server responds with live_redirect command (50-100ms)
  4. Client finally navigates to new view Total: 110-250ms + handler processing time

โœ… Right โ€” using dj-navigate directly:

<!-- Right: Client navigates immediately, no server round-trip -->
<a dj-navigate="/items/{{ item.id }}/">View Item</a>

What happens:

  1. User clicks link โ†’ Client navigates directly Total: ~10ms (just DOM updates)

Why it matters:

  • Performance: 10-20x faster navigation
  • Network efficiency: Saves WebSocket bandwidth
  • User experience: Instant response, no loading indicators needed
  • Simplicity: Less code, fewer moving parts

When to Use live_redirect() in Handlers

Use handlers for navigation only when navigation depends on server-side logic or validation:

โœ… Conditional navigation after form validation:

@event_handler()
def submit_form(self, **kwargs):
    if self.form.is_valid():
        self.form.save()
        self.live_redirect("/success/")  # OK: Conditional on validation
    else:
        # Stay on form to show errors
        pass

โœ… Navigation based on auth/permissions:

@event_handler()
def view_sensitive_data(self, **kwargs):
    if not self.request.user.has_perm('app.view_sensitive'):
        self.live_redirect("/access-denied/")  # OK: Auth check required
        return
    self.show_sensitive = True

โœ… Navigation after async operations:

@event_handler()
async def create_and_view_item(self, name, **kwargs):
    item = await Item.objects.acreate(name=name, owner=self.request.user)
    self.live_redirect(f"/items/{item.id}/")  # OK: Navigate to newly created item

โœ… Multi-step wizard logic:

@event_handler()
def next_step(self, **kwargs):
    if self.current_step == "payment" and not self.payment_valid:
        # Stay on payment step if invalid
        return
    self.current_step = self.get_next_step()
    self.live_patch(params={"step": self.current_step})  # OK: Conditional flow

Common theme: The handler does meaningful work before navigating. If your handler only calls live_redirect(), use dj-navigate instead.

Quick Example: Multi-View App

from djust import LiveView
from djust.mixins.navigation import NavigationMixin
from djust.decorators import event_handler

class ProductListView(NavigationMixin, LiveView):
    template_string = """
    <!-- Filter within same view: use dj-patch -->
    <a dj-patch="?category=electronics">Electronics</a>
    <a dj-patch="?category=books">Books</a>

    <div>
        {% for product in products %}
            <!-- Navigate to different view: use dj-navigate -->
            <a dj-navigate="/products/{{ product.id }}/">{{ product.name }}</a>
        {% endfor %}
    </div>
    """

    def mount(self, request, **kwargs):
        self.category = "all"
        self.products = []

    def handle_params(self, params, uri):
        """Called when URL changes via dj-patch or browser back/forward"""
        self.category = params.get("category", "all")
        self.products = Product.objects.filter(category=self.category)

Learn More:

  • ๐Ÿ“– Navigation Guide - Complete API reference (live_patch(), live_redirect(), handle_params())

Developer Tooling

Debug Panel

Interactive debugging tool for LiveView development (DEBUG mode only):

# In settings.py
DEBUG = True  # Debug panel automatically enabled

Open: Press Ctrl+Shift+D (Windows/Linux) or Cmd+Shift+D (Mac), or click the ๐Ÿž floating button

Features:

  • ๐Ÿ” Event Handlers - Discover all handlers with parameters, types, and descriptions
  • ๐Ÿ“Š Event History - Real-time log with timing metrics (e.g., search โ€ข 45.2ms)
  • โšก VDOM Patches - Monitor DOM updates with sub-millisecond precision
  • ๐Ÿ”ฌ Variables - Inspect current view state

Learn More:

Event Handlers

Always use @event_handler decorator for auto-discovery and validation:

from djust.decorators import event_handler

@event_handler()
def search(self, value: str = "", **kwargs):
    """Search handler - description shown in debug panel"""
    self.search_query = value

Parameter Convention: Use value for form inputs (dj-input, dj-change events):

# โœ… Correct - matches what form events send
@event_handler()
def search(self, value: str = "", **kwargs):
    self.search_query = value

# โŒ Wrong - won't receive input value
@event_handler()
def search(self, query: str = "", **kwargs):
    self.search_query = query  # Always "" (default)

๐Ÿ—๏ธ Architecture

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Browser                                    โ”‚
โ”‚  โ”œโ”€โ”€ Client.js (~29KB gz) - Events & DOM   โ”‚
โ”‚  โ””โ”€โ”€ WebSocket Connection                   โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
           โ†•๏ธ WebSocket (Binary/JSON)
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Django + Channels (Python)                 โ”‚
โ”‚  โ”œโ”€โ”€ LiveView Classes                       โ”‚
โ”‚  โ”œโ”€โ”€ Event Handlers                         โ”‚
โ”‚  โ””โ”€โ”€ State Management                       โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
           โ†•๏ธ Python/Rust FFI (PyO3)
โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  Rust Core (Native Speed)                   โ”‚
โ”‚  โ”œโ”€โ”€ Template Engine (<1ms)                โ”‚
โ”‚  โ”œโ”€โ”€ Virtual DOM Diffing (<100ฮผs)          โ”‚
โ”‚  โ”œโ”€โ”€ HTML Parser                            โ”‚
โ”‚  โ””โ”€โ”€ Binary Serialization (MessagePack)    โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐ŸŽจ Examples

See the examples/demo_project directory for complete working examples:

  • Counter - Simple reactive counter
  • Todo List - CRUD operations with lists
  • Chat - Real-time messaging

Run the demo:

cd examples/demo_project
pip install -r requirements.txt
python manage.py migrate
python manage.py runserver

Visit http://localhost:8000

๐Ÿ”ง Development

Project Structure

djust/
โ”œโ”€โ”€ crates/
โ”‚   โ”œโ”€โ”€ djust_core/        # Core types & utilities
โ”‚   โ”œโ”€โ”€ djust_templates/   # Template engine
โ”‚   โ”œโ”€โ”€ djust_vdom/        # Virtual DOM & diffing
โ”‚   โ”œโ”€โ”€ djust_components/  # Reusable component library
โ”‚   โ””โ”€โ”€ djust_live/        # Main PyO3 bindings
โ”œโ”€โ”€ python/
โ”‚   โ””โ”€โ”€ djust/             # Python package
โ”‚       โ”œโ”€โ”€ live_view.py         # LiveView base class
โ”‚       โ”œโ”€โ”€ component.py         # Component system
โ”‚       โ”œโ”€โ”€ websocket.py         # WebSocket consumer
โ”‚       โ””โ”€โ”€ static/
โ”‚           โ””โ”€โ”€ client.js        # Client runtime
โ”œโ”€โ”€ branding/                    # Logo and brand assets
โ”œโ”€โ”€ examples/                    # Example projects
โ”œโ”€โ”€ benchmarks/                  # Performance benchmarks
โ””โ”€โ”€ tests/                       # Tests

Running Tests

# All tests (Python + Rust + JavaScript)
make test

# Individual test suites
make test-python       # Python tests
make test-rust         # Rust tests
make test-js           # JavaScript tests

# Specific tests
pytest tests/unit/test_live_view.py
cargo test --workspace --exclude djust_live

For comprehensive testing documentation, see Testing Guide.

Building Documentation

cargo doc --open

๐Ÿ’ฐ Supporting djust

djust is open source (MIT licensed) and free forever. If you're using djust in production or want to support development:

  • โญ Star this repo - Help others discover djust
  • ๐Ÿ’œ GitHub Sponsors - Monthly support from $5/month

Your support helps us maintain and improve djust for everyone!

๐Ÿค Contributing

Contributions welcome! Please read CONTRIBUTING.md first.

Areas we'd love help with:

  • More example applications
  • Performance optimizations
  • Documentation improvements
  • Browser compatibility testing

๐Ÿ“ Roadmap

  • Template inheritance ({% extends %})
  • {% url %} and {% include %} tags
  • Comparison operators in {% if %} tags
  • All 57 Django built-in template filters
  • Security hardening (WebSocket origin validation, HMAC signing, rate limiting)
  • Developer debug panel with event history and VDOM inspection
  • Reusable component library (djust_components crate)
  • JIT pipeline improvements and stale-closure fixes
  • Authentication & authorization (view-level + handler-level)
  • File upload handling
  • Server-sent events (SSE) fallback
  • React/Vue component compatibility
  • TypeScript definitions (djust.d.ts shipped with the package)
  • Redis-backed session storage
  • Horizontal scaling support

๐Ÿ”’ Security

  • CSRF protection via Django middleware
  • XSS protection via automatic template escaping (Rust engine escapes all variables by default)
  • HTML-producing filters (urlize, unordered_list) handle their own escaping internally
  • WebSocket authentication via Django sessions
  • WebSocket origin validation and HMAC message signing (v0.2.1)
  • Per-view and global rate limiting support
  • Configurable allowed origins for WebSocket connections
  • View-level auth enforcement (login_required, permission_required) before mount()
  • Handler-level @permission_required for protecting individual event handlers
  • djust_audit command and djust.S005 system check for auth posture visibility

Report security issues to: security@djust.org

๐Ÿ“„ License

MIT License - see LICENSE file for details.

๐Ÿ™ Acknowledgments

  • Inspired by Phoenix LiveView
  • Built with PyO3 for Python/Rust interop
  • Uses html5ever for HTML parsing
  • Powered by the amazing Rust and Django communities

๐Ÿ’ฌ Community & Support


djust.org โ€” Made with โค๏ธ by the djust community

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

djust-0.3.5.tar.gz (2.8 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

djust-0.3.5-cp312-cp312-win_amd64.whl (4.8 MB view details)

Uploaded CPython 3.12Windows x86-64

djust-0.3.5-cp312-cp312-manylinux_2_34_x86_64.whl (4.7 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

djust-0.3.5-cp312-cp312-macosx_11_0_arm64.whl (4.5 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

djust-0.3.5-cp312-cp312-macosx_10_12_x86_64.whl (4.6 MB view details)

Uploaded CPython 3.12macOS 10.12+ x86-64

djust-0.3.5-cp311-cp311-win_amd64.whl (4.8 MB view details)

Uploaded CPython 3.11Windows x86-64

djust-0.3.5-cp311-cp311-manylinux_2_34_x86_64.whl (4.7 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.34+ x86-64

djust-0.3.5-cp311-cp311-macosx_11_0_arm64.whl (4.5 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

djust-0.3.5-cp311-cp311-macosx_10_12_x86_64.whl (4.6 MB view details)

Uploaded CPython 3.11macOS 10.12+ x86-64

djust-0.3.5-cp310-cp310-manylinux_2_34_x86_64.whl (4.7 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.34+ x86-64

djust-0.3.5-cp39-cp39-manylinux_2_34_x86_64.whl (4.7 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.34+ x86-64

File details

Details for the file djust-0.3.5.tar.gz.

File metadata

  • Download URL: djust-0.3.5.tar.gz
  • Upload date:
  • Size: 2.8 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for djust-0.3.5.tar.gz
Algorithm Hash digest
SHA256 fb8343453d74a3e84c85d655712f4738fdd8a90147fb386358a266e06534bdb7
MD5 58b8a0769c13a485d5539ca6cbd6d024
BLAKE2b-256 e5930e079258cf499de9589de481245a9d80f8d09d0d925285bdef3b7abd09c0

See more details on using hashes here.

Provenance

The following attestation bundles were made for djust-0.3.5.tar.gz:

Publisher: release.yml on djust-org/djust

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file djust-0.3.5-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: djust-0.3.5-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 4.8 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for djust-0.3.5-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 976b4d722364334a367ff63866e87fd1015df772ea1afa7bb53af586e919b93a
MD5 608ec49d5541644be26ca537f3611d57
BLAKE2b-256 52b896440432a756b5c984a49c21580fc468b1eafc5c9897aaf1b015ad0d3e98

See more details on using hashes here.

Provenance

The following attestation bundles were made for djust-0.3.5-cp312-cp312-win_amd64.whl:

Publisher: release.yml on djust-org/djust

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file djust-0.3.5-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for djust-0.3.5-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 22c6ea0d9f8dfe19f21b3308baed37b764e7c3e35620a1e4c1910beb1dec61aa
MD5 405ba81161b74e6977ddbc6a1f5a6288
BLAKE2b-256 bd1a4bcd029736a56e7b9eab8f534b3e3b5015178b096f5354aef795049281fb

See more details on using hashes here.

Provenance

The following attestation bundles were made for djust-0.3.5-cp312-cp312-manylinux_2_34_x86_64.whl:

Publisher: release.yml on djust-org/djust

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file djust-0.3.5-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for djust-0.3.5-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2ffbe1cec6158aa108b4daf602521b8356b179db75b8ec1e87f0460b0b910b2d
MD5 e908f87dc5f0071285ad7cac9b105788
BLAKE2b-256 573200d2d13f83a3581d49b70fea6f26a2cc2ece55f771c5f0f5685a56f2bfa7

See more details on using hashes here.

Provenance

The following attestation bundles were made for djust-0.3.5-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: release.yml on djust-org/djust

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file djust-0.3.5-cp312-cp312-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for djust-0.3.5-cp312-cp312-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 5d5a9547005e315212fca710bb3ca6665a3ed62d75bdc4986456541c121c6c26
MD5 a2bc5eb01f02619c3b4e349a5c967dc9
BLAKE2b-256 889fe18e7ea4dc31e531225ffd8d8b6229ec0af62eafe4e40fa257212f5a5cc2

See more details on using hashes here.

Provenance

The following attestation bundles were made for djust-0.3.5-cp312-cp312-macosx_10_12_x86_64.whl:

Publisher: release.yml on djust-org/djust

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file djust-0.3.5-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: djust-0.3.5-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 4.8 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for djust-0.3.5-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 5cf39d701540ed6854970a0e53c94985499f0314179209f9aba2ea0c9540d300
MD5 b4af17458eef5cd087fe2a148207ff44
BLAKE2b-256 bf35f5fea1ad9979bfc637846e683a30491ecc6abcc3bc8a1ac01501b453783e

See more details on using hashes here.

Provenance

The following attestation bundles were made for djust-0.3.5-cp311-cp311-win_amd64.whl:

Publisher: release.yml on djust-org/djust

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file djust-0.3.5-cp311-cp311-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for djust-0.3.5-cp311-cp311-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 68f2dd5a09a27147082faceaebb52cf4a60b8c2726c4ab2084f32c432472918b
MD5 3c9e164e379d28ca6f682023f598a8b1
BLAKE2b-256 da90126369c8ccbcfda1e3f55ea8b8bc0c4bc48dcd019bbe9e83e6c1f89de292

See more details on using hashes here.

Provenance

The following attestation bundles were made for djust-0.3.5-cp311-cp311-manylinux_2_34_x86_64.whl:

Publisher: release.yml on djust-org/djust

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file djust-0.3.5-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for djust-0.3.5-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fc0df41e643fd65c2b417766598d1ee42e0aa821e047199ebbf2dbf0560e8e1f
MD5 2c1f55e805a2c9d4e32e48a576ba94e4
BLAKE2b-256 0ce98510e8f7276e8f8ab13dafbed6ecb17e1f4ed6899c84a048febf9bd0302c

See more details on using hashes here.

Provenance

The following attestation bundles were made for djust-0.3.5-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: release.yml on djust-org/djust

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file djust-0.3.5-cp311-cp311-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for djust-0.3.5-cp311-cp311-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 48666eca107d791ba285834baaceda82b25e88a0c659a2c3f0caf46f73790237
MD5 38483d7f67bc6949b6632c2136de72f1
BLAKE2b-256 6f5acd8a1372f3ce6506621bf47fbbb2d3cceef0ce39beba1e7111c634468326

See more details on using hashes here.

Provenance

The following attestation bundles were made for djust-0.3.5-cp311-cp311-macosx_10_12_x86_64.whl:

Publisher: release.yml on djust-org/djust

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file djust-0.3.5-cp310-cp310-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for djust-0.3.5-cp310-cp310-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 f54de1d55a1eae06ddda3296922faf9db8581df8f8639fd95f6588e9d9471c6b
MD5 246f7051ab0c4624cce0dc854ed5361d
BLAKE2b-256 ec7c48b9c51f7d211084cfd4384b6db2ef6420643ad2207b07535849bda07634

See more details on using hashes here.

Provenance

The following attestation bundles were made for djust-0.3.5-cp310-cp310-manylinux_2_34_x86_64.whl:

Publisher: release.yml on djust-org/djust

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file djust-0.3.5-cp39-cp39-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for djust-0.3.5-cp39-cp39-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 4843dca3cc8a3654980606aa41d7f9bc683f80519e3d90fab458794c1b7413c3
MD5 6dd686e31f6f6d3670ee7aa07dccd075
BLAKE2b-256 52002b0a8cc55f425911794d461a4a7d644b60010b52f03bb4567a22048f9a79

See more details on using hashes here.

Provenance

The following attestation bundles were made for djust-0.3.5-cp39-cp39-manylinux_2_34_x86_64.whl:

Publisher: release.yml on djust-org/djust

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page