djust docs
Browse documentation
beginner

Start here.Build something live.

Your Django skills. A reactive interface. Go from your first live view to a complete application, one guide at a time.

On this page

djust is Django with reactive templates. Your view's state lives in Python on the server. When it changes, djust re-renders the template and patches only the changed parts of the DOM over a WebSocket. You write Python; there is no JavaScript to write and no build step to run.

Keep these close

The whole thing

A working live counter. Two files.

# myapp/views.py
from djust import LiveView
from djust.decorators import event_handler


class CounterView(LiveView):
    template_name = "myapp/counter.html"

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

    def get_context_data(self, **kwargs):
        return {"count": self.count}

    @event_handler()
    def increment(self, **kwargs):
        self.count += 1
<!-- myapp/templates/myapp/counter.html -->
{% load live_tags %}
<!DOCTYPE html>
<html>
<head>{% djust_client_config %}</head>
<body>
  <div dj-root>
    <h1>Count: {{ count }}</h1>
    <button dj-click="increment">+1</button>
  </div>
</body>
</html>

That is the entire feature. Clicking the button sends an event over the WebSocket, djust calls increment(), re-renders in Rust, and patches the one text node that changed.

What you did not have to do

  • No npm install, no bundler, no node_modules
  • No REST or GraphQL endpoint, no serializers, no client-side state store
  • No second language for the UI, and no API contract to keep in sync
  • No full-page reload

The path

Three pages, in order, and you will have the model:

  1. Install and configure djust — a pip install and three settings.
  2. Build your first LiveView — the counter above, with the parts explained.
  3. Core concepts — why the template is on the server, what happens on each event, and what "state" means here.

Then pick a door

  • What do you want to do? — find the page for the task in front of you. Best if you already know what you are building.
  • Learn — the guided build path, one feature at a time.
  • Look up — reference for LiveView, decorators, components and testing.

Just evaluating?

Skip the path. The counter above is the whole architecture, so there is nothing hidden behind it. For scope, skim the template cheat sheet — every dj- directive on one page — and security for the things handled for you rather than by you.