djust docs
Browse documentation
reference

Class attributes

Class attributes on the LiveView base class, generated.

On this page

Class attributes on LiveView, generated from the framework manifest.

8 entries.

login_required

Type: Optional[bool]

Require authenticated user. Set to True to protect, False to acknowledge public.

login_url

Type: Optional[str]

Override settings.LOGIN_URL for this view's auth redirect

permission_required

Type: Optional[Union[str, List[str]]]

Django permission string(s) required to access this view

template

Type: Optional[str]

Inline template string (alternative to template_name)

Example

template = "<div>{{ count }}</div>"

template_name

Type: Optional[str]

Path to Django template file

Example

template_name = 'myapp/counter.html'

temporary_assigns

Type: Dict[str, Any]

Assigns to clear from server memory after each render. Values are the reset defaults. Use with dj-update='append' in template.

Default: {}

Example

temporary_assigns = {'messages': [], 'feed_items': []}

tick_interval

Type: Optional[int]

Periodic tick interval in milliseconds (e.g., 2000 for 2s polling)

use_actors

Type: bool

Enable Tokio actor-based state management for high-concurrency views

Default: False

Configure a view

from djust import LiveView

class DashboardView(LiveView):
    template_name = "myapp/dashboard.html"
    login_required = True
    permission_required = "myapp.view_report"

Declare configuration on the class; initialize per-view state in mount(). See Authorization for access control and LiveView API for the broader view contract.