Phoenix LiveView-style reactive server-side rendering for Django with Rust-powered performance
https://djust.org β HEALTH ? 100 / Healthy
Phoenix LiveView-style reactive server-side rendering for Django with Rust-powered performance
https://djust.org β// readme
djust brings Phoenix LiveView-style reactive views to Django. You write server-side Python; the browser updates itself over a WebSocket. There is no JavaScript to write, no bundler, and no build step in your project.
djust.org Β· Documentation Β· Quick Start Β· Examples
from djust import LiveView, event_handler
class CounterView(LiveView):
template = """
<div dj-root>
<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 # the page updates; no JavaScript
@event_handler
def decrement(self):
self.count -= 1