Before you upgrade, read Removed, Deprecated below.
Added
- A project's own template filter that reads a field of each item (a sort, group or pluck by a field name it is handed) can opt in to the item-key extraction
dictsorthas: decorate it withdjust.template_filters.item_key_filter(or setdjust_item_key = Trueon it) and its quoted argument is filed on the list, so a LiveView row carries that field. A quoted key containing a combining mark (e+ U+0301) is now a key, as Django reads it, instead of being ignored (#3920). WizardMixin.get_wizard_steps()andresume_wizard(): steps that depend on the record (#4011).get_wizard_steps()(default: the class'swizard_steps) lets a wizard choose its steps per instance, from names it keeps in state, without overriding the private_steps.resume_wizard()appliesget_wizard_initial()/get_wizard_step(); a view whose steps are known only after its ownmount()has loaded a record calls it at the end of thatmount(). New cases inpython/djust/tests/test_wizard_steps_hook_3982_4011.py.resume_wizard()is never a client event, in anyevent_securitymode.- System check
djust.V028lists each class that statesexposure_policy = "legacy"(#4047). The 2.0 plans described this check (asV022, an id another check holds) and listed it as shipped in 1.3.x; it did not exist. It reports the class whose body states the policy, once, with the views that inherit it, a hint to rundjust_exposure_inventoryand the migration-guide link. djust's own classes are skipped. The plan documents carry dated corrections. 6 regression cases inpython/tests/test_legacy_exposure_check_4047.py. - System check
djust.V029: an explicit view's event handler changes a value a later event reads, and the HTTP fallback does not keep it (#4053). Under explicit exposure the page-POST fallback builds a new view for each event and runsmount()again, restoring onlystate(..., persist="server")fields, so a counter kept in an attribute set inmount(), or declaredstate(0)withoutpersist, answered every fallback event from itsmount()value with no error (over a WebSocket it counted). V029 reports a handler that changes such a value when the handler reads it first (self.count += 1,self.items.append(...),self.x = f(self.x)) or another handler orget_context_data()reads it; a value a handler only recomputes from its own arguments is not reported. The README and the getting-started, LiveView and events counters now declarecount = state(0, persist="server"), which counts on every transport. New cases inpython/djust/tests/test_undeclared_handler_state_v029_4053.py. - A template
{{ items_count }}that explicit exposure no longer generates is named (#4054). djust 1.x deriveditems_countfrom a QuerySet or listitems; explicit exposure does not, so a 1.x template reading it rendered empty with no signal (the name is not an attribute, so the unsupplied-name warning never saw it). WithDEBUG = Truethedjust.exposurelogger now names it once per view class and name, whenitemsis in the context as a QuerySet, list, tuple or set, and points at{{ items|length }}; the stem's type is tested, never its contents (a QuerySet is not evaluated).djust.T027reports the same template name whenitemsis supplied. Documented in the migration guide,docs/system-checks.mdand the error-code reference. - System check
djust.C031warns about a session store only one process can see (#4103). WithDEBUG = False, acacheorcached_dbsession engine overLocMemCache(orDummyCache) is reported: djust keeps view state in the session, so a request or socket served by another process mounts fresh. The hint names the stores every process shares. New cases inpython/djust/tests/test_process_local_stores_4103_4104.py. - System checks
djust.C032anddjust.C033warn about messaging and presence that stay inside one process (#4104). WithDEBUG = False, an in-memory channel layer (push_to_view(), broadcasts, presence updates anddb_notifynever reach another process's sockets) and the memory presence backend used by aPresenceMixinview (each process counts only its own users) are reported as Warnings naming the Redis alternatives. The scaling and state-survival guides say so next to the survival table. New cases inpython/djust/tests/test_process_local_stores_4103_4104.py. - Patches over the stateless HTTP page-POST fallback (#4108). The page POST is the only
transport that needs no sticky routing, and it answered every event with the whole page. It
now renders the restored view once before the handler and once after, and answers with the
difference, when the pre-handler render is the page the browser shows. The proof is a
token in two halves: an HMAC of the render (keyed from
SECRET_KEY, bound to the session, the signed-in user, the path and the view), which the page GET and every answer carry and the client echoes, and the shape of the render's tree (every element with its attributes, every text), which the client computes from its own DOM and the server compares with its own render, so a patch is never applied to a page that a script, a hook or a playingdj-removeexit has rearranged, whenever that happened. Any mismatch (a first request, another tab, a deploy, a render that differs each time, a changed DOM) gets the whole page exactly as before. The pre-handler render runs on a throwaway copy of the view, so nothing it evaluates is reused by the render after the handler. Nothing is stored. On a counter page an answer goes from 671 bytes to 129; on a 100-row table with one changed cell from 28,971 to 134; and a patch answer leaves unsent input, an opened<details>and client-set classes alone. It costs a second render per patched event (up to about twice the server time of the whole-page answer;get_context_data()and the context processors, and any side effect they have, run twice):http_fallback_patches = Falseon a view, orLIVEVIEW_CONFIG["http_fallback_patches"] = False, keeps the single render and the whole page. Fallback answers of 200 bytes or more are now gzipped for a client that accepts it (LIVEVIEW_CONFIG["http_fallback_compress"]), a patch answer that cannot be applied asks for the page again with a POST that runs no handler and keeps the saved state (X-Djust-Resync: 1) instead of reloading, and the default ids of{% toolbar %}and{% theme_tooltip %}now repeat on every render. See the HTTP-only guide. {% kanban_board %}cards can be limited to the columns they may move to, and move by keyboard (#4120). A card'stargets(column ids: a list, any iterable of strings, or one string) renders asdata-targets; while the card drags, only those columns take a drop and are markedkanban-col-target, so the browser shows no drop elsewhere. Yourmove_eventhandler must still check the move. Every card takes focus: Space picks it up, the arrow keys choose an allowed column, Enter or Space drops it there and sends the samemove_eventas a drag (over WebSocket, SSE or the HTTP fallback alike), and Escape or moving focus away cancels; each step is announced in a polite live region, a visually hidden hint says how before a card is picked up, and focus returns to the card after the re-render moves it. A column id with whitespace logs a warning, sincedata-targetsis space-separated. The markup contract in the components guide listsdata-targetsand the new classes.- System check
djust.V030(#4129): a view or mixin that defines or assignsskip_render,request_full_render,cancel_full_render,reset_submitted_form,clear_push_eventsorget_theme_statereplaces djust's method of that name (an@event_handlerof that name can be called by the client); the check reports it. - Public forms of private names applications relied on (#4129).
LiveViewgainsskip_render(),request_full_render(),cancel_full_render()(withdraws only this turn's request; a full render the framework requires stays),reset_submitted_form()andclear_push_events();ThemeMixingainsget_theme_state();djust.testinggainsrender_template_string()andrender_component();djust.get_function_component()looks up a registered function component; the newdjust.introspectionmodule lists the project's views (live_views(),live_components()) and the authorization each declares (view_auth_info()). The private names (_skip_render,_force_full_html,_should_reset_form,_pending_push_events,_theme_state,management._introspect,djust_audit._extract_auth_info) keep working. The zero-argumentset_changed_keys()is documented as the way to re-render after a database-only change. - A pluggable store for saved view state, with a built-in sealed store.
DJUST_STATE_STORE = "dotted.path"names where the state a view keeps between requests is held; with nothing set it stays in the Django session, laid out exactly as before.djust.state_store.SealedSessionViewStateStoreencrypts it (AES-256-GCM) in the session entry with keys you supply inDJUST_STATE_STORE_KEYS(the first seals, every one opens, so a key is rotated by putting the new one first; there is no fallback toSECRET_KEY; installdjust[sealed-state]forcryptography). Your own store subclassesdjust.state_store.ViewStateStore(load,save,deleteunder aStateKey; optionalstatsandclearfordjust stats/djust clear) and only moves opaque bytes: djust keeps the envelope and every check on it (session, user, tenant, route and tab binding, expiry, size limits, which names may be restored), so a store that returns another caller's bytes, an older write or garbage yields a freshmount(), never another caller's state. The session keeps one index entry per tab with no values, so the tab cap and size budgets work without the store listing its contents. Store calls run as a new"state_store"step ofsync_turn_wrapper(a wrapper that raises on a step name it does not know must let it through). When the store is unreachable while an event saves, the response is served, an error is logged and the view starts frommount()next time;DJUST_STATE_STORE_STRICT = Truerefuses the event instead (code="state_error", HTTP 503 on the page-POST fallback). Fields declaredpersist="server"do not go through the store in this version and stay in the session as before; a lazyexposure_policy = "legacy"child's fallback state does not either, so with a store named it is not saved (the child mounts again on each fallback request) rather than written to the session in the clear. Enabling a store removes state saved in the clear earlier from a session on that session's first request, anddjust clear --allnow also removes a lazy legacy child's saved entry (it was left behind before). djust deletes a state from the store when it evicts it ordjust clearremoves it, never on logout: give your store anexpiressweep. New system checksdjust.C036(the store cannot be used),djust.C037(the sealed store has no usable key or nocryptography) anddjust.C038(DJUST_STATE_STORE_STRICTis not a bool). Guide:docs/website/state/state-store.md. (#4132) - Django 6.1: Add compatibility coverage, template parity improvements, and an opt-in
FETCH_PEERSintegration benchmark. DJUST_STATE_SAVE_INTERVAL: a WebSocket or SSE turn may answer before its state is saved (off by default). Set to a number of seconds (0.5 to 60), a socket turn of a view with no declaredpersist=field sends its reply without waiting for storage, and the view's state is saved no later than the interval after the first unsaved change, when the connection closes, before a navigation replaces the view, and at the ASGIlifespanshutdown. A URL change, a turn that queues navigation, a turn whose handler wroterequest.session,@event_handler(save=True),self.save_state(), a strict store and a view with declared persistence still save before the reply; the HTTP fallback is unchanged. A view'sstate_save_intervaloverrides the setting; system checksdjust.C040(an interval that cannot be used) anddjust.C041(an interval a strict store makes moot). With an interval set, each socket mount and fallback request for a tab records a new holder token in the session, and a socket's save is refused only when another, unexpired token is recorded, so an older connection for the same tab cannot write over a newer one, even after the tab's saved state was evicted, deleted or expired; with no other token recorded (wiped, dropped, expired) the socket is the holder and records its token again. Exact under a database row lock; on cache, file and SQLite a writer paused between its read and write is not refused (see the docs page for the measured rates). The default (0) keeps every turn saved before its reply. Seedocs/website/state/save-frequency.md.- A signal for the name an explicit view holds but does not supply. Under explicit
exposure a template name that nothing supplies renders empty, and a view written for 1.x
(
self.count = 0inmount(),{{ count }}in the template) does exactly that. Two things now say so. WithDEBUG = True, the first time such a view renders, djust logs one warning per view class and name on thedjust.exposurelogger: the view, the name, the fix (return it fromget_context_data(); declare it withstate()to persist it or send it to the browser) and the migration guide. It names attributes and never logs a value, and withDEBUGoff it does nothing. And system checkdjust.T027(Warning) reports the same frommanage.py check, for a view whoseget_context_data()returns a literal dict orsuper()'s and whose template does not use{% extends %}.
Changed
The
2.0development branch now builds as2.0.0.dev0(#3500). The version is2.0.0.dev0inpyproject.toml,__version__,uv.lockand the SBOM, and2.0.0-dev.0inCargo.tomlandCargo.lock.make versionnow maps a PEP 440.devNsuffix to the Cargo-dev.Nform.BREAKING:
StreamingMixin's asyncstream_insert/stream_deleteare nowastream_insert/astream_delete(#3500).StreamsMixincomes first inLiveView's bases and has sync methods with the same names, so on aLiveViewthe async pair was only reachable asStreamingMixin.stream_insert(self, ...). Nowawait self.astream_insert(...)andawait self.astream_delete(...)work directly, andself.stream_insert/self.stream_deleteare unambiguously the sync collection-stream API. ReplaceStreamingMixin.stream_insert(self, ...)withself.astream_insert(...), and the same for delete.The last helper methods of the safe-markup audit escape their own parameters (#3845).
OrgChartNode._render_nodeandFeedbackWidgetNode._render_thumbs/_render_stars/_render_emojitook an event name the caller had already escaped, so the guard, which judges a method's parameters raw (a subclass in any file can call one), could not prove them and they were audited by hand. They now take the event as it is and escape it where it is written: the markup is the same for every value, a subclass that calls one with raw text is covered, and the guard provesOrgChartNode.renderandFeedbackWidgetNode.render.FileTreeNode._render_tree_nodeand theFileTreecomponent's_render_nodewriteint(depth), which provesFileTreeNode.render. No "private to this class" contract was added to the guard: no function in the tree needs one any more (python/tests/test_safe_markup_batch_3845_3847.py, gate-off listscripts/safe-markup-batch-3845-3847-gateoff.json).Safe-markup guard binds a nested helper's parameters from its call sites (#3845): a function nested in another, whose name is only ever the callee of a plain call there, is judged with what those calls pass (and its defaults), so the density toggle of
DataTableHandlerand the tree node oftree_vieware proved and leave the audited baseline. A method is not bound this way (a subclass anywhere can call it with anything); its cluster-A entries stay audited.Safe-markup guard narrows
str(x) in TABLE(#3846): on the branch where it holds, the expressionstr(x)(notx) is a value from the table for as long asxkeeps its bindings and on every path into the use;AgentStepHandler/AgentStepNodeandRibbonHandler/RibbonNodeare proved and leave the audited baseline.ProgressHandlerleaves the safe-markup audit (#3847). It read["value"]of the Python tag's context dict, whose other keys are raw, so the guard could not tell which part was clean. It now readsint(...)of it (the tag's clamp already is one), and the guard proves the handler. The core layout renderer (_root_layout_html, which the four layout handlers share since 2.0) stays audited: it joins byte slices of the engine-rendered body, which no typed return describes.Safe-markup guard type facts (#3847): the elements of
calendar.Calendar(...).monthdayscalendar(...), adatevalue'sisoformat()/weekday()/.year/(a - b).days, anddjust.components.utils.interpolate_color(also through astaticmethodclass alias) are clean;CalendarViewHandler/CalendarViewNode,CalendarHeatmapHandler/CalendarHeatmapNodeandHeatmapHandlerleave the audited baseline.AppShellHandlerandProgressHandlerneed a typed return rather than a rule and stay audited.A context processor that returns a different plain value on every turn now costs a render on every turn (#3996). This follows from the fix above and is deliberate; it matters for a processor that returns, say, the current time as a string. (a) The node that reads the value is rendered again on every turn that renders. (b) A bound component's event can no longer be answered with the component's own patch, because that patch would leave the value stale: it takes the page render, which on the
component_idroute is a fullhtml_updateframe. (c) The context processors run once per component event (they did not run at all for a scoped component patch). The page render that follows a refused scoped patch reuses that run, so it is one run per event, not two. No turn triggers another. To keep component events as scoped patches, do not supply a per-turn value from a context processor: return a lazy object, or read the clock in the template.python/djust/tests/test_per_turn_oracle.py.An explicit view's turn encodes its saved state once, not three times (#3997). The automatic save JSON-encoded the whole state for its text, again per attribute for the digests, and again as the envelope only to measure its length; each value is now encoded once and the rest is built from those encodings (the same characters). The state encoder handles a container's scalar members in one loop instead of a call each, and the save's name rule is built once per save and asks only about the view's own attributes. On
make benchmark-turn(new: complete event turns, explicit against legacy, release build) the explicit-minus-legacy cost of a turn that changes one cell of a 500-row table went from 7.1 ms to 5.6 ms (1.70x to 1.54x legacy); a counter and a 30-value dashboard moved by 0.1-0.2 ms. What remains is mostly the session read, decode and write each saving turn makes; reducing it changes where saved state is kept, which is left for a decision.python/djust/tests/test_explicit_turn_cost_3997.py.An explicit view's turn no longer recompiles its exposure contract or hops to a thread for a snapshot it will not mint (#3997).
ExposureContract.from_view_classand the provider manifest were compiled two to four times on every turn, each time walking every class dictionary in the view's MRO. They are now compiled once per class and re-checked on every use against the class dictionaries (keys in order, values by identity) and each field's exposure, so a class changed after creation, a subclass, a class built at run time and a hot-replaced class all get their own, current contract. The event snapshot took two thread hops on a view with nopersist="client"field, to produce an answer that is always "no token"; it now takes none when the turn's save has just checked the same request's binding, and one hop instead of three when a token is minted. The save itself, its binding check, authorization on every turn and commit-before-success are unchanged. Not done, because each changes what a save means and needs a decision: skipping the save hop when nothing is persisted (it carries the binding check) and skipping the session write on a turn that changed nothing (it refreshes the stored state's age).python/djust/tests/test_per_turn_invalidation.py,python/djust/tests/test_per_turn_counts.py,python/djust/tests/test_per_turn_oracle.py.A connected view holds less memory, and the scaling guide states how much (#3998). A view kept two whole fingerprint trees of its containers for as long as its socket was open (the dirty-tracking baseline and the last render's), each about three times the size of the rows, plus its own copy of the template source. A fingerprint now keeps a
str/int/bytes/Noneleaf as the value itself and a dict's items as one flat tuple, the two trees share their rows, and the source text is one copy per template in the process. Counted per view after one event (Python side as CPython 3.12 sizes objects): a 1,000-row table 7.3 MB to 5.2 MB, a 500-row table (56 KB page) 3.7 MB to 2.6 MB, a 50 KB static page 0.81 MB to 0.76 MB. No frame changes: the per-turn oracle compares every frame with the old encoding and with the new. The guide's "Memory per connected view" section gives the formula (37 KB + P × page_bytes + S × state_bytes) and the bytes per owner;test_view_memory.pyfails when a published number is more than 10% from what it measures.RustLiveView.retained_bytes()reports the Rust side per owner.A changed list of plain rows is walked three times in Python per turn, not four (#3999). When a changed attribute is itself a context value and is plain data (exact
dict/list/tuplenodes and immutable leaves), the walk that collected theid()of every object under it is skipped: the only context values it could find are containers, which are compared by structural fingerprint anyway, and immutable leaves, which cannot have changed. On a 1,000-row list that is one walk of 18,001 nodes less per turn; it also stops unrelated scalars that happened to share an interned object with a row (0,True, a short string) from being re-sent. Whether the value is plain is decided by the walk that converts it for the renderer, on the object being sent. A container holding live objects is walked as before. Not done: reusing the post-event snapshot's fingerprint in the state sync.get_context_dataruns between the two and may change the container, so the older fingerprint cannot stand in for the current one (a test pins that case); item-level deltas and the two-region text fast path are Rust work and are left for their own change.python/djust/tests/test_per_turn_invalidation.py,python/djust/tests/test_per_turn_counts.py.{% theme_head %}no longer links the component catalog's stylesheet by default (#4003). Withdjust.componentsinstalled it used to linkdjust_components/components.css(331,482 bytes, 47,861 gzipped) on every page, including every page of a newdjust newproject. It is now linked whenLIVEVIEW_CONFIG["theme"]["component_catalog_css"]isTrue, or on one page with{% theme_head component_catalog=True %}(the theme gallery and catalogue pages pass it). The theme pack's owndjust_theming/css/components.css(56,800 bytes) is linked as before. New system checkdjust_theming.W004reports a project that installsdjust.componentswithout stating the setting. Thedjust newscaffold keepsdjust.componentsinstalled, statescomponent_catalog_css: False, and its base template is plain markup instead of{% app_shell %}, so a starter page loads 331 KB less CSS.The Chart.js adapter redraws only when the canvas's attributes change (#4004).
<canvas dj-hook="Chart">calledchart.update()after every server update, about 1.3 ms of script and 130-180 KB of garbage per turn for unchanged data. The attribute-gated update thatdj-chart-update="attributes"opted into is now the default;dj-chart-update="always"restores the old behaviour for a chart whose plugins read state from outside its attributes, anddj-chart-revisionstill invalidates explicitly.Eight more rarely used built-in filters run Django's own function (#4005).
cut,last,random,dictsort,dictsortreversed,ljust,rjustandcenternow calldjango.template.defaultfilters.<name>instead of a Rust port. They stay built-ins (no{% load %}, the same parse-time checks), and their output, escaping and exceptions are Django's own;randomdraws from Python'srandom, sorandom.seed()governs it as in Django. djust's guards stay in front of the call:ljust/rjust/centerstill refuse a width past 1,000,000 with the same message before Python is asked to allocate it,dictsort/dictsortreversedstill walk a generator or other one-shot iterable through the 100,000-item cap, and a model row is read through its floor proxy.last,randomanddictsorthand back the context's own values, so{% with x=rows|last %}{{ x.name }}keeps working.escape,escapejs,default_if_noneandforce_escapestay native, because they are not cold: a Python call per value cost 1.8-2.9x on a 500-row render for the first three, and every hybrid-template attribute slot ends inforce_escape.Interactive components on an explicit-exposure view: migration notes (#4046). A view that declares a
DropdownMenuor a collection of them runsmount()on every HTTP-fallback POST, also for a plain view event and for a refused request (a collection's rows come frommount()'ssync()). A menu'scomponent_idis derived from its declaration, and an event must carry the id the page rendered (data-component-id), which is that id, a.and a tag: the barecomponent.component_idis refused, and a CSS selector built from the page's id must escape the dot (CSS.escape). A saved collection (the default on an explicit view) takes keys of at most 128 characters;persist=Falseand legacy views keep no limit. Event waiters still receive the component's owncomponent_id.The MCP
scaffold_viewtool declares template state withstate()(#4050). A generated list view declaressearch_query,pageandeditingon the class, where they render by default, instead of setting them inmount()and handing each one over inget_context_data(), which now returns only derived and render-only values (items,selected_item,total_pages).A field declared with
state()renders in the template by default (#4050). Under explicit exposure,count = state(0)makes{{ count }}render with noget_context_data().get_context_data()stays for derived and render-only values and wins over a declared field of the same name. Rendering grants nothing else: the field reachesget_state()and the HTTP API'sassignsonly withclient=True, and survives a reconnect only withpersist=. Undeclared attributes still render empty.state(render=False)keeps a field out of the template (a legacy view refuses it). A provider-owned name (online_count, a formset name,streams,csrf_token) is still rendered by its provider, and a framework-reserved name (request,view,kwargs) never renders through a declaration. The DEBUG unsupplied-name warning anddjust.T027treat a declared field as supplied, and still name one declaredrender=Falseor dropped by aget_context_data()that does not callsuper(). A declared field shadows a same-named context-processor value; a field nameduserorpermsis flagged by the new system checkdjust.V027and, underDEBUG, adjust.exposurewarning.djust_exposure_inventoryno longer suggests handing a declared field over.@computedvalues andassign_async()results are unchanged: return them fromget_context_data().PR and merge-queue CI now run the whole-tree pins (#4051). The slow tier (
-m "not slow", every test recorded over 1 s) left out the ratchet, inventory and doc-table tests that read every source file, so four of them went red onmainonly after merge. 22 such tests across seven files now carry@pytest.mark.pr_tier(279 s of recorded time, about 70 s per shard), andtests/test_whole_tree_pins_run_on_prs_4051.pyfails when a slow test whose file or name looks like a pin is neither marked nor allow-listed with a reason. The twotest_safe_markup_audit_3774runtime sweeps (about 6 min each) stay in the full tier.Breaking: a
state()field named after a framework-reserved name is refused when the view class is created (#4070).template_name = state(...),temporary_assigns,request,kwargs,page_titleand every other name indjust._exposure.reserved_state_names()raiseExposureConfigurationErrornaming the field and suggesting a rename, whether the field is in the view's class body, on a plain mixin or on a base class, and also when a mixin's__init_subclass__skipssuper()(the field's__set_name__refuses it). A field such a mixin contributes, or astate()assigned to the class after the class statement, is refused on the mount path. Such a class used to import and then crashcheck_liveviewsor fail at render. The type guards indjust_auditand the schema extractor stay, andcheck_liveviews(Q007) now readstemporary_assigns/static_assignsonly when they are collections: a property or astate()assigned after the class statement still reaches those readers. New cases inpython/djust/tests/test_reserved_state_names_4070.py.Breaking (test helper):
LiveViewTestClient.mount()runs the pre-mount sequence every transport runs (#4073). Beforemount()it now callsdjust.auth.core.run_pre_mount_auth(the view's tenant resolve and bind, thenlogin_required,permission_requiredandcheck_permissions(); its async twin for anasync def check_permissions), then the view'son_mounthooks (djust.hooks.run_on_mount_hooks) with the mount kwargs. It used to callmount()with none of them, so a test could mount a view the HTTP GET and the socket refuse. A refused user raisesPermissionDenied; an anonymous user on alogin_requiredview, or a hook that returns a URL, raises the newdjust.testing.MountRedirect(itsurlis that URL). Either waymount()does not run and the client is not mounted. The parity helper_build_mounted_instance()goes through the same sequence. A test that mounted a gated view without a user must now passuser=(or set"user"in aLiveViewSmokeTestview_config). New cases inpython/djust/tests/test_testclient_pre_mount_auth_4073.py.LiveViewTestClientrunsconnected()and applies@rate_limit, as the transports do (#4085). Breaking for tests.mount()(the defaultvia_websocket=True) now runs the view'sconnected()hook aftermount()andhandle_params(), through the runtime's ownbegin_live_connection; an exception from it propagates after the view'sdisconnected()has run.send_event()applies a handler's@rate_limitthroughdjust.rate_limit.http_handler_rate_check, the helper the HTTP fallback and the HTTP API call: an event past the budget does not run and returnssuccess=False,code="rate_limited". The budget is per caller and lasts across clients and tests in one process, so a test that sends a rate-limited handler more thanburstevents now sees refusals; calldjust.rate_limit.reset_handler_buckets()in a fixture to start each test with a full budget.LiveViewSmokeTestdoes this for each fuzz payload. Not modelled: the connection's abuse disconnect (4429) and its global per-message limit. New cases inpython/djust/tests/test_testclient_connected_and_rate_limit_4085.py.djust clearanddjust statsact on the view state saved in sessions (#4087). Since 2.0 view state lives in the session, and the state backend's view cache is filled by nothing.djust statsreports the sessions holding saved state, their number of states and size;djust clearremoves expired saved states (every one with--all) and leaves the rest of each session alone. Both still report and clear the state backend, and say so when the session engine cannot list its sessions (onlydbandcached_dbcan). The backends'get()/set()/refresh()stay available and are documented as no longer used by the framework. New cases inpython/djust/tests/test_cli_saved_state_4087.py.handle_restore()runs at the same point on every transport (#4088). On a WebSocket or SSE mount it used to run right after the saved state was put back, beforehandle_params(); on the HTTP fallback it ran afterhandle_params()and the object-permission check. It now runs at the fallback's point everywhere: afterhandle_params(), the saved state's re-apply and the object-permission check, before the first render. A view whosehandle_params()read somethinghandle_restore()loaded must now load it inhandle_params()itself (or inget_context_data()), andhandle_restore()no longer runs for an object the permission check denies.A view's state is saved server-side between requests again, as in 1.x; client exposure stays explicit. After the page load and after each event that changed it, a page view's state is saved in the server-side session: its public attributes, the
_privateattributesmount()created, itsstate()fields and the state of the components it holds. Over the HTTP fallback a later request rebuilds the view from that state and does not runmount()again, then runshandle_params()andhandle_restore(); while the query string is the one the state was saved under, what a handler set goes back overhandle_params()'s defaults, and when the query changedhandle_params()has the last word for what it assigns (on a socket mount too). Over a socket, a mount or reconnect runsmount()and puts back only what a handler changed sincemount(), so whatmount()computes (a permission flag, a loaded model instance) is fresh on every socket mount. A full page load runsmount()and starts a new saved state. No declaration is needed, and nothing becomes renderable or client-settable by being saved: the template, the client state, signed snapshot tokens and debug payloads still come fromstate()declarations andget_context_data()only. Differences from 1.x, each deliberate: one saved state per tab (the page carries a tab id; two tabs on one route no longer share state; at most 8 per route are kept); every plain Python value comes back with its type (tuples, sets,Decimal, dates and times,UUID, bytes, enum members); a value that cannot be saved (a queryset, the request's user, an arbitrary object) is skipped with one WARNING on thedjust.automatic_statelogger instead of being turned into a string, and makes the next fallback request runmount()again so it is re-created; saved state past 512 KB per view (DJUST_AUTOMATIC_STATE_MAX_KB,automatic_state_max_kb) refuses the event's change whole, with a warning from 100 KB (DJUST_AUTOMATIC_STATE_WARN_KB), and is never saved in part; the store is bound to the session, user, tenant and route and expires withDJUST_SERVER_STATE_MAX_AGE; password, one-time-code and payment-card form inputs are never stored. A model instance is saved as a dict of its fields, as in 1.x. The newstate(..., persist=False)keeps a field out;persist="server"keeps its strict behaviour and stays per route.djust.V029now reports only a handler that reads and then changes apersist=Falsefield. A view on the deprecatedexposure_policy = "legacy"saves nothing. A page load is served even when its session row cannot be updated while its state is saved (one WARNING per view class; nothing is saved for that load). The tab id meta goes inside<head>, or right after<html>or the doctype on a page without one, never before a doctype. A connected view keeps one compressed encoding of its saved state and a digest per attribute for this, not a second copy: about 3 KB per view, about 13 KB for a 1,000-row list (the per-view memory table in the scaling guide is republished). Declaredpersist="server"fields and undeclared attributes follow one URL rule: at the URL the state was saved under, the saved value wins over whathandle_params()assigns (so a declared field a handler set is no longer reset to the hook's default by a later request at the same URL); at another URLhandle_params()wins for what it assigns. (#4107, #4106)The local test load guard needs a time-limited approval for a whole-suite run, and allows one heavy run at a time (#4111). Outside CI a run over 5,000 tests now needs a Unix time at most 24 hours ahead in
~/.djust/full-run-approval, written by the developer;DJUST_FULL_LOCAL=1alone no longer bypasses the limit. An approved run holds a machine-wide lock, so a second one refuses at once from any worktree. CI,make test-earlyand targeted runs are unaffected. New cases intests/unit/test_local_load_guard_4111.py.Re-reading held rows after a write changes what some views do (#4112). Each change, with its escape:
A handler that writes to a table the view reads (through a held QuerySet, a cached property or a query its render runs) and changes nothing else on the view now renders; it used to answer
noopwith the old rows. Escape:self.skip_render()in that handler; the rows are then re-read at the view's next render. A write to a table the view does not read is still anoopwith no re-read: on a view holding 5,000 rows, a click that inserts into an unrelated table measured anoopand 3 statements on bothmainand this change, at 3.5 to 4.9 ms against 3.4 to 5.9 ms onmainacross interleaved runs (within the machine's noise).When a re-read happens it is everything the view holds, not only what the write touched: every held QuerySet (one query per prefetch level) and every cached property, then the render of the rows (measured 210 to 215 ms for 5,000 held rows on SQLite and on PostgreSQL). Escape:
frozen_rowsfor a deliberate snapshot or an expensive cached value.A write djust cannot name (raw SQL with unquoted table names, a schema-qualified name,
TRUNCATE,MERGE, aWITHcontaining a write, DDL, several statements in one), a read it cannot follow (a function,ONLY,TABLEor a parenthesised join inFROM), held rows or a cached value filled outside the view's own steps and renders, and a restored state each make the next write re-read everything: slower, never stale for the writes djust sees.A
handle_tick()that writes to a table the view reads now renders on every tick. Escape: list a heartbeat table inDJUST_IGNORED_WRITE_TABLES(writes todjango_sessionand toDatabaseCachetables never count), or callself.skip_render()in the tick. djust's own per-turn session and user checks are not reads of the view, so a tick that writesauth_userdoes not render for that reason. The other side: a view that lists rows of an ignored table (django_session, a cache table, a table you listed) is not re-read when a step writes to it; callself.rows_changed()there.Writes the database makes by itself (triggers,
ON DELETE CASCADE, rules, a model over a database view) are not seen.DJUST_REFRESH_ON_ANY_WRITE = True(off by default) makes every write a view's step makes re-read everything; the new Info checkdjust.C042names unmanaged models andDB_*cascades while it is off.A project test that counts queries on a turn that writes a table the view reads sees one more per held QuerySet (one per prefetch level).
A render step now records the view's reads:
sync_step(view, "render", fn)returns a wrapper offnrather thanfnitself.connection.execute_wrappersis no longer empty: djust puts one recorder at index 0 of every connection's list when it connects. Measured on SQLite in process: about 0.7 µs per query outside a view's step or render and about 0.7 µs inside one (3.45 µs per query without it). A project'sexecute_wrapper()blocks still add and remove their own.QuerySet._fetch_allis wrapped so a QuerySet notes which view's step filled it (one dictionary write per evaluation).Cost of the bookkeeping: a turn that wrote nothing looks only at the view's cached properties (about 1.4 µs per render or step). A write to a table the view reads is decided without walking (the reset then walks). A write to a table it does not read walks everything the view holds once, at any depth and with no size limit, skipping plain values by type, to confirm every held QuerySet was filled by the view's own steps: about 0.007 ms for one QuerySet, 1 ms for 5,000 model instances or 100,000 numbers, 2.6 ms for 5,000 dicts each holding a model, 3 ms for 5,000 record dicts. On a view holding 5,000 rows a click that inserts into an unrelated table measured 3.0 to 3.3 ms against 2.8 to 2.9 ms for a click that writes nothing (one more statement).
make benchmark-turn(40 rounds, counter / table500 / dashboard) stays within run-to-run noise ofmain.HTTP fallback patches: no render token for opted-out views; excluded shape attributes documented (#4114). A page GET and a fallback answer no longer compute the render token when
http_fallback_patches = Falseis set on the view or inLIVEVIEW_CONFIG, so opted-out views (and projects) skip its cost and their pages carry nodjust-render-digestmeta. The HTTP-only guide now names every attribute the DOM shape leaves out, includingdata-open,data-current,data-positionanddata-visible, which djust's own widgets write in the browser; the client and server lists are pinned equal by a test and a shared vector.{% kanban_board %}works under a strict CSP and without "Add card" (#4120). A column with nocolor(or a refused one) no longer gets an inlinestyle="border-top-color:#6366F1"; a theme name (primary,success,warning,destructive,info,muted) renders as the classkanban-col--<name>, and any other CSS colour keeps its inline style.add_card_event=Noneleaves the "+ Add card" button out, and a card'shrefmakes its title a link. The markup the client's drag and drop reads is documented as a contract ("Kanban board markup" in the components guide), andKanbanBoard's docstring says it does not drag. Same output on Django's engine and djust's.{% nav_menu %}/{% nav_item %}draw the same classes on both engines: under the Django engine a nested item now usesdj-nav__item/dj-nav__link(anddj-nav__item--active) at every depth, as the native handler does, instead ofdj-nav__dropdown-item/dj-nav__dropdown-link.components.cssstyles a nested item as a dropdown entry by position (.dj-nav__dropdown-list .dj-nav__item) and keeps thedj-nav__dropdown-item/-linkrules for markup that still names them. A falsyclass=(None) no longer adds the classNoneunder the native engine. If a theme or script selects the old classes on Django-path markup, switch it:.dj-nav__dropdown-itembecomes.dj-nav__dropdown-list .dj-nav__item,.dj-nav__dropdown-linkbecomes.dj-nav__dropdown-list .dj-nav__link, and.dj-nav__dropdown-item--activebecomes.dj-nav__dropdown-list .dj-nav__item--active(the Django path no longer emits the old names; the native path never did) (#4127).Saved view state can be switched off, and a subclassed session store now holds it.
DJUST_AUTOMATIC_STATE = Falsein settings saves nothing of any view between requests, and the class attributeautomatic_state = Falsedoes the same for one view (Truethere overrides a project that switched it off). Explicit exposure is unchanged; only saving is. With it off nothing of the view's undeclared state,_privatestate, component state or changed/deleted record is written to the session on any transport, each page-POST fallback request runsmount()again and a socket reconnect starts frommount(). A field declaredstate(..., persist="server")is still kept: it was asked for by name. OnlyTrueandFalseare accepted; any other value is read as off and reported by the new system checkdjust.C035. This replaces 1.x'sview_state_in_session = False, and the startup error for that removed key now names the replacement. Check your session engine: saved state andpersist="server"fields now work with aSESSION_ENGINEwhoseSessionStoresubclasses Django'sdb,cached_db,cacheorfilestore, where earlier 2.0 pre-releases accepted only those exact classes. A project with such a subclass had nothing saved until now and will start saving view state in its session on upgrade; setDJUST_AUTOMATIC_STATE = Falseto keep saving nothing. An engine built on none of those stores (for examplesigned_cookies) still saves nothing, and the new system checkdjust.C034says so at startup and names both ways out. The switch also covers a lazy legacy child's state over the fallback (saved only while saving is on for the page and for the child); an embedded child's own state is never saved automatically. Turning the switch off removes a tab's earlier saved state on that tab's first request or reconnect. The switch placed insideLIVEVIEW_CONFIGorDJUST_CONFIGis a startup error naming the top-level setting, andself.automatic_state = ...on an instance logs one warning per view class (it is a class attribute). System checkdjust.C031(a session cache local to one process) now also recognises aSessionStorethat subclasses thecacheorcached_dbstore. (#4128)A close or dismiss button has an off state (#4134).
close_event=Noneon{% modal %},{% sheet %},{% bottom_sheet %},{% lightbox %},{% command_palette %}and{% export_dialog %},dismiss_event=Noneon{% announcement_bar %},{% page_alert %}and{% toast_container %}, andevent=Noneon{% alert %}now leave the control out (the ×, the backdrop click, the Cancel button and the native dialog's close event) on both template engines, as{% kanban_board %}'sadd_card_event=Nonealready did. On{% modal native=True %}the browser's own Escape and backdrop click are refused too, and a close the browser lets through is undone while the view still has the dialog open, so only the view closes it.Falseand""mean the same, since none of the three is an event name. Before, each drew a control sendingNone(or nothing) that every click had rejected.djust.T019no longer reports these; it still reportsNoneon a control the tag is for (a toggle, a step, previous and next), which has no off state.Tests only: the guard pairs named in #4155 now each have a test that fails without one of them. The two stale-view checks in WebSocket background work (after the callback, and inside the result turn under the render lock) are told apart, on the success and the error path; so are the two drops of
_cacheRequestId(the WebSocket/SSE dispatch route, and strict parameter validation); and a WebSocket mount whosemount()raises is pinned to leave the channel groups it joined.Tests that fail late now run early (the promotion ledger). When the nightly
main-healthsuite fails,scripts/promotion_ledger.py promoteadds each failing test that PR CI does not run totests/promotion-ledger.json, and PR and merge-queue CI then run it even though it is slow; it leaves after 30 consecutive green nights unless pinned, within a 180 s budget. The nightly only posts the ledger patch on an issue; it never pushes. Path rules run the tree-scanning pins (MERGE_GATES) before merge whenever a change adds, deletes or renames a test module, the check-ID pins when a system check changes, and the client-size pins when client JS changes.make test-earlyruns the whole early tier locally. Seedocs/testing-strategy.md, "The early tier".Component tags render through one path where it costs nothing (S3 first slice, #4002). Under the Rust engine a
djust_componentstag now renders the Python tag's own Django node through the{% load %}bridge (#2547), registered at startup so no{% load %}is needed; about 160 hand-written native twins inpython/djust/components/rust_handlers.pyand their parity pins are gone. A native twin is kept only where a benchmark earns it or the bridge lacks a capability, each pinned against its Python tag with its divergences listed: the core layout tags (root-proof protocol),badge/avatar/progress/pagination/data_table(4 to 8x slower through the bridge;data_table's native-only features stay, #3869), andaccordion,sidebar,nav_menu,toolbar,filter_bar,form_array,page_headerwith their child tags (the bridge would hand their body to Django's engine, which cannot compile{% call %}/{% component %}/{% slot %}/{% dj_suspense %}). On a bridged tag a LiveView page now renders the Django engine's markup: class names, ARIA anddj-*attributes as the Python tag draws them; arguments accepted or refused as Django does (a parameter given by position and by keyword is Django's render-timeTypeError);as varbinds; the native-only context fallbacks are gone ({% breadcrumb %}readingbreadcrumb_items,{% stepper %}readingsteps,{% autocomplete %}/{% dependent_select %}readingsuggestions/options,dj_select options_var=,dj_radio current_value_var=).tooltip,otp_inputandtag_inputderive their default id from their arguments plus the call's occurrence among identical calls in the same render (-2,-3, counted in the render's own context), instead of drawing a new one per render (a patch on every LiveView turn): stable across renders and unique within one. The inclusion templates (badge,avatar,progress,pagination,table,toast) escape every caller value written into an attribute withforce_escape, so a marked-safe value cannot leave it (#4009). The twin-drift issues (#3663, #3768, #3849, #3882, #3883) no longer apply to the bridged tags (reproductions inpython/tests/test_component_single_render_path.py) and stay open for the kept twins.System check
djust.C304now reads declared client state: it warns about astate(..., client=True)field, including apersist="client"one, whose name looks like a credential or personal data. It used to read the public attributes of views that set the removedenable_state_snapshot.The WebSocket and SSE client transports share one inbound frame path (#3500). The receipt-time routing (page-shell fallback, mount metadata, signed snapshot, frames for views mounted beside the page view) and the side-channel frames both transports applied the same way now live once, in
python/djust/static/djust/src/02c-frame-dispatch.js. Behaviour is unchanged, except that the SSE transport now also applieslayoutframes, the fix #3527 makes onmain.BREAKING: a component template the Rust engine rejects now raises.
Componentrendering used to catch any Rust render error and render the template again with Django'sTemplate, so a template the Rust engine rejected rendered differently and silently. The error now propagates. An inline component template that uses{% include %}or{% extends %}keeps working: the Rust render now gets the project's template directories, which is what the Django re-render used to supply.LiveView.exposure_policydefaults to"explicit"(ADR-038 Step R). It was"legacy". A view that states no policy now gets only what it declares: its template context is whatget_context_data()returns (plus the framework's own providers and Django's context processors), server-side persistence is itsstate(..., persist="server")fields, and the browser receives as data only itsstate(..., client=True)fields. Under"legacy"every public attribute set onselfwas template context, and much of it also reached session state and the client state mirror.What breaks. A view written for 1.x whose template reads attributes that nothing supplies renders those names empty, with no error. Its state is no longer restored on the HTTP POST fallback or (with
enable_state_snapshot) on a reconnect, a component assigned inmount()is an error, an interactive component's events need a WebSocket or SSE connection, and time-travel restore and replay are refused. In production an explicit view's failures are value-free in logs and error frames; underDEBUGthey read as before.To keep the old behaviour on a view, state it:
class OldView(LiveView): exposure_policy = "legacy"A base class your views inherit from carries it for all of them. There is no setting that changes the default. To migrate a view, see Migrating to djust 2.0 and explicit exposure;
manage.py djust_exposure_inventory --view myapp.views.MyViewlists what the view exported.The same default applies wherever djust reads a policy from something that has none: an object that is not a view no longer counts as legacy when djust decides whether it may use a legacy export or restore path, and
djust_exposure_inventoryreports such a class as explicit. Error diagnostics are unchanged for those owners: a failure handled while no view exists (a view whose constructor or mount failed), or on behalf of a component or a formset class, is logged as it was, and a view that states"legacy"keeps its detailed production logs in those cases.The README and the guides' executed examples (interactive components, navigation
params_form, the shared room clock, time-travel debugging) supply their template context inget_context_data(). The component catalogue's usage snippets do too: a template-tag example supplies each name its tag reads, and a Python-component example holds its component inself._componentand hands it over ascomponent(a component in a public attribute is an error on an explicit view). The MCPscaffold_viewtool supplies every name its view sets.djust newanddjust_gen_livealready generated explicit views.The views and mixins djust ships work under
exposure_policy = "explicit"(ADR-038 Step R). This is the groundwork for making explicit exposure the default, which this release also does (see the entry on the default).Mixins. Under explicit exposure a template gets only what it is given, so a mixin's public attributes rendered empty. Each of these now supplies its own names, render-only (nothing is stored or sent to the browser as data), and a legacy view is untouched:
PresenceMixin(online_count),TutorialMixin(tutorial_running,tutorial_current_step,tutorial_total_steps,default_highlight_class),DataTableMixin(itstable_*configuration and state; nevertable_model,table_queryset, a callable, or a class-level value that is not plain data),FormSetHelpersMixin(the formsets named informset_classes) andThemeMixin(theme_preset,theme_mode,theme_resolved_mode, with or without thetheme_contextprocessor). The first four register their names as context providers, so on an explicit view an application write of one of them inget_context_data()is a collision error, as it already is forFormMixin's keys; declaring the name (online_count = state(0)) is fine. An explicit view that listsDataTableMixinorFormSetHelpersMixinafterLiveViewis refused when the class is defined, because the mixin would never be asked for its names.Views. These are now explicit: the admin index, delete, logout and bulk-action progress views, the two auth admin pages, the component gallery (index and nine category pages) and the component catalogue (index, category and detail pages). The social accounts page's search, sort, filter and page are declared
state(..., persist="server"), so the page keeps them from one request to the next when it runs without a WebSocket, as the legacy session save did. The public gallery and catalogue pages declare no persisted field (it would make them need a server-side session and authentication middleware), so without a WebSocket their search and collapsed groups are not carried to the next request.Pinned to
exposure_policy = "legacy", each for something explicit exposure does not offer yet: the admin change list and change form (they embed the ModelAdmin's widget views, and an explicit page cannot hold a legacy child), the interactive dropdown example and its catalogue page (an interactive component is reachable over the HTTP POST fallback only on a legacy view),TtydTerminalView(a base class: a subclass's own attributes render through the attribute walk),PersistentLiveViewand the function-based@live_viewdecorator.Scaffolding.
djust new(every flag combination and--from-schema) anddjust_gen_livegenerate views withexposure_policy = "explicit"whoseget_context_data()returns a literal dict that spreadssuper()'s context.Behind a session-only WebSocket stack (
DjustMiddlewareStack), a view with explicit exposure now mounts. Such a request has nouser, and an explicit mount binds its state to one, so it used to be refused. The mount now reads the user from the session, as each explicit event already does, after the usual access check has run on the request as the stack built it: alogin_requiredorpermission_requiredview is still refused behind that stack, and a legacy view still gets norequest.userthere. Every access decision judges the request that way (view and handler permissions,check_permissions,has_object_permission,on_mounthooks), so a gated child embedded in a public page, or a permission-gated handler on one, is refused there as it would be on a legacy view. The same holds over SSE on a project withoutAuthenticationMiddleware: the stream's mount and each event POST read the user from the session.The set of shipped LiveView classes and each one's policy is pinned in
python/djust/tests/test_exposure_framework_views.py; the mixins are covered inpython/djust/tests/test_exposure_framework_mixins.py.DJUST_STATE_SNAPSHOT_MAX_AGEis read in one place. The signed client snapshot ofpersist="client"fields and the service worker'sstate_snapshot_max_agenow use the same validated value (djust._exposure_snapshots.get_max_age, still importable fromdjust.security). A whole number of seconds from 1 to 86400 is used as given, including a string of digits from an environment variable. A larger value is capped at 86400, and anything else falls back to 3600; each is logged once. Before, a value above 86400 or a string turned the explicit snapshot off without a word while the service worker went on using it.One list of reserved
state()names (#4070). The names astate()field may not take aredjust._exposure.reserved_state_names(): the exposure contract and the rendered-state names both read it (#4070), in place of the explicit path's reads oflive_view._FRAMEWORK_INTERNAL_ATTRS. Its public names (RESERVED_STATE_NAMES:request,args,kwargs,view_is_async, the view settings) are the old set's public subset, plus theLiveViewclass namespace,viewand the client-unsafe keys; the old set's underscore names are not repeated because no state field name can start with_. The change-detection skip list isdjust.change_detection.CHANGE_DETECTION_IGNORED, with the same membership as before. No accepted or refused name changes. Refusing a reserved name when the class is created (#4070) is prepared behind a switch that is off pending a decision.Nine rarely used built-in filters run Django's own function.
filesizeformat,get_digit,iriencode,linenumbers,slugify,unordered_list,urlize,urlizetruncandwordwrapnow calldjango.template.defaultfilters.<name>instead of a Rust port. They stay built-ins (no{% load %}, the same parse-time checks), and their output, escaping and exceptions are Django's own: a bad argument towordwraporurlizetruncraises Django'sValueError, and a huge value now renders infilesizeformatwhere the port gave0 bytes. Each call costs a Python call per value. About 1,500 lines of Rust are gone, including thetextwrapandurlquotemodules.Ten more rarely used built-in filters run Django's own function.
addslashes,capfirst,linebreaks,linebreaksbr,make_list,phone2numeric,striptags,truncatechars_html,truncatewords_htmlandwordcountnow calldjango.template.defaultfilters.<name>instead of a Rust port. They stay built-ins (no{% load %}, the same parse-time checks), and their output, escaping and exceptions are Django's own.striptagsnow follows the running interpreter'shtml.parser, as Django's does, instead of a pinned transcription of it, and an input past Django's stripping-depth guard raisesSuspiciousOperationwhere the port rendered"".phone2numericon a non-string raises Django'sAttributeErroritself. About 2,300 lines of Rust are gone, including thehtmlparsermodule.BREAKING: a Rust template-inheritance or JIT-serialization failure now raises instead of degrading.
- Template inheritance: when
resolve_template_inheritancefails for a view's{% extends %}template (for example a template directory missing from the search path),get_template()raisesRuntimeErrornaming the template and the directories searched. Before, it logged a warning and the initial HTTP GET served thedj-rootfragment without the base template's<head>(#1801). Templates that hit that path now error instead of rendering half a page. The JIT variable-extraction lookup raises the same error instead of silently using the single-file source. - JIT serialization: a failure serializing a QuerySet or model for the
template raises
RuntimeError(the cause is chained). Before, it logged and re-serialized throughnormalize_django_value, which re-ran the query and sent every concrete field instead of the ones the template reads. Thejit_serializationsetting still turns the JIT serializer off.
- Template inheritance: when
Fixed
- Preserve main's object serialization and render-cache refresh after the 2.0 removals: use mandatory JIT serialization and the canonical state-backend module. Update the transport parity harness to send same-origin HTTPS requests under the current origin policy.
- Template roots in layouts: Preserve authored root and model-binding proof through the built-in app shell, sidebar, header and content wrappers using verified body slices. Reject changed namespaces and invalid copies while keeping opaque output and lazy-registration safeguards intact.
- Preserve the async turn-wrapper step for HTTP background results. Synchronous
handle_async_resulthooks reached through the HTTP fallback now run under theasyncstep, matching the socket paths. - Child ownership: Keep child registrations aligned with authenticated root diffs and ignored DOM reuse. Child bindings commit only after render-ledger validation; injected ignore boundaries cannot retain handlers. Cold WebSocket, SSE, view-slot and HTTP fallback reconciliation removes stale child controls while preserving the surrounding client widget. Fresh HTTP baselines and preserved sticky slots retain their correct identities.
- Root diffs: Reject known root-namespace changes before deferred child mounts or incremental baseline updates, preventing silent empty patches. Use full navigation to change a mounted root's namespace; fresh HTTP documents remain supported.
- Safe-markup guard: every part is placed by text the guard read, or reported (#3864). The second pass of the guard now reads the whole string a sink is handed (
_Module._misplaces) the way a browser's tokenizer does: element text, tags, quoted and unquoted attribute values, comments (abrupt ones such as<!-->included),<script>/<style>bodies, RCDATA and RAWTEXT elements (<textarea>,<title>,<xmp>,<noscript>, ...), foreign content, character references (decoded at the start of a URL, and refused where the next part could complete one). A part is read as literal text wherever it can be spelled out (each spelling of a name, a branch, a constant table ordict.get, a tuple, a narrowed name,str()/.strip()/.replace()/ a slice of a literal, a class attribute, a%/.format/format_map/string.Template/ f-string field,+=pieces in straight-line code, a function or lambda of the file with its call's arguments), and otherwise as the class of what it can do to the position. A part the guard cannot read may sit in element text only, and nothing positioned may follow it. On an escaper's output, padding with a plain fill, a case change,strip()and a slice keep its class,!r/%rare read with their quotes, and areplace()or fill that brings back"'<>&and%c/{:c}are placed nowhere (escape(x).replace(""", '"')).max/min/sumof a comprehension of numbers reads as a number. Before, an unread earlier part counted as an ordinary character (pre() + safe_url(x)was cleared whereprereturns'<a href='from one of two branches), a balanced fragment was placed unchecked inside a value, a helper's markup in a larger string was not looked into, and an HTML escaper between attributes or as a tag name was cleared. The arguments offormat_html/format_html_joinare now placed where they land in the format string. A function the file replaces without adef(sys.modules[__name__].f = ...,setattron the module,f.__code__ = ...) is no longer followed. A finding says which part lands where ([position: ...]). The per-builder HTML-context check this replaces is removed. Newly reported sites in the package are audited (three handlers that rewrite a rendered block body at an offset;format_htmlwith a configured URL inhref/src; two theming<style>bodies). Rows judged by a browser's parser (jsdom), a randomized differential that runs every generated module, and a gate-off list:python/tests/test_safe_markup_position_3864.py,safe_markup_position_fuzz_3864.py,scripts/safe-markup-position-gateoff.json. - Demo app: the page header's action links go through
safe_url, and the icon name throughattr_text(#3864).examples/demo_project/djust_rentals/components/page_header.pyput each action'surlintohrefwith onlyformat_html's HTML escaping, which does not stop ajavascript:URL, and the header icon name into markup unescaped. {% nav_menu %}draws every nesting level under the Django template engine (#3873, #3878). The Django tag drew top-level items and one level of dropdown children, and read only the DIRECT child nodes of its body, so a third-level{% nav_item %}(and itsdj-click), an item inside{% if %}/{% for %}, and other body content were dropped, where djust's own engine drew them. Each item now renders its body as the native handler is handed it: an item with sub-items at any depth is a dropdown, and the menu's list is its rendered body. A top-level item draws itsdescription=too, as natively.- Which
{% nav_item %}is active now agrees between the engines. An item is active only on a non-emptyid/hrefmatch (under Django every item without anidwas active when the menu had noactive); an item's ownactive=is read before the menu's; and the menu'sactive=now reaches its items on djust's own engine too (it highlighted nothing there). - The template-library parity baseline is regenerated. Its checker reported
nav_menuas WORSE in the first pass: that is the checker comparing fewer variants because the menu node no longer reads its items' arguments (nav_itemreads them), not a regression.nav_item's one extra escaping variant is the top-leveldescription=it now draws, under the existing escaping policy (the Django tag keeps a marked-safe value, the native handler escapes it). {% filter_bar %}draws the controls a template nests in a condition under the Django template engine (#3878). The Django tag read only the DIRECT child nodes of its body, so a{% filter_search %}inside{% if %}/{% for %}, a bar inside the bar and any other content were dropped, where djust's own engine drew them. The bar now renders its body: every control it rendered is the bar's, and the rest is kept after the controls, as natively.- A raw-body block tag nested in itself rendered half its body (part of #3878). The Rust
parser ended a raw-body tag's body at the FIRST matching end tag, so
{% tabs %}inside a{% tabs %}body left the outer end tag over asInvalid block tag. The body now ends at the end tag that closes the tag, as Django's ownparser.parsedoes, and a same-named tag inside{% comment %}is not counted (collect_nested_raw_sourceincrates/djust_templates/src/parser.rs). A raw-body handler may also declarevalidate_at_parse, so{% tabs val %}is refused when the template compiles, as Django does. {% dj_suspense await=v %}no longer reads a variable's value as the names to await (#3882). The names were looked up in the context, so a value chosen at render time could pick which entry gated the body and whose failure message was printed. The awaited names are the template's own words (await="metrics", as documented); a resolvedawait=renders the fallback and logs a warning. A resolvedfallback=is not used as a template name either (the default fallback is shown and a warning logged), and a resolved emptyawait=no longer renders the body ungated.{% djust_markdown %},{% dj_flash %}, the PWA tags and{% live_render %}take a resolved argument as the text it is (#3882). Their shared argument reader,TagHandler._resolve_arg, looked an argument the engine had already resolved up in the template context a second time when it was shaped like a variable name or dotted path, so text that spelt one printed that value instead of the text ({% djust_markdown comment.body %}with a comment readinga.b). The engine is now the one resolver of an argument; an attribute the template itself names, such aspost.body, is still resolved by the engine. A third-partyTagHandlerthat called_resolve_argon a bare name to read a context variable now gets the text back: readcontextdirectly.- A tag argument that the engine had already resolved is no longer looked up in the template
context a second time (#3882). Text that spelt a variable name or dotted path printed that
value instead of the text:
{% nav_menu toggle_event=ev %}withev = "items"printed the value of the variableitems, where Django printsitems. The kept native component twins (every handler indjust.components.rust_handlers), the theme-tag handlers and{% call %}/{% component %}/{% slot %}now take a resolved value as the operand, the component name of{% call name %}included. Every operand those handlers read passes one conversion,djust.components._operands.plain_operand: marked-safe and lazy strings become plainstr, so they are escaped as they were when they arrived as text. Bridged library tags (alert,card,tooltip, ...) render through their Django tag and print a marked-safe value as markup, as before and as Django does. Contract and pins inpython/tests/test_native_operand_contract.py. - The native
{% avatar %}takes its initials from the text, not from its escaping. Analtstarting with a quote,<or&(O'Brien) showed half an HTML entity (O&). - A resolved keyword value of a
TagHandlertag is read once (#3883).{% djust_pwa_manifest name=v %}withv = "label=x"rendered the Python tuple('label', 'x'), and a padded value lost its padding. The value now passes through as the text it is. A resolved string that is itself quoted still loses its quotes: the text cannot tell it from a quoted literal, and telling them apart needs the typed channel the component handlers have. - A resolved
"007"stays"007"in aTagHandlertag (#3883).TagHandler._resolve_argread any digit string as an integer, so{% djust_markdown v %}withv = "007"rendered7. Only the canonical spelling of an integer is read as one. - A string argument reaches a native component handler as the string it is (#3883). The
engine handed a native handler a resolved string as text, and the handler read the text as
source:
"false"becameFalse,"007"became7,"1e3"became1000.0, and a string with quotes around it lost them. The engine now hands every resolved operand except a list or dict (which arrive as JSON) to the handler as its value (TYPED_ARGS_STANDINS_ONLY), and the handler takes it as it is. For every parameter of every kept native twin a resolved string renders exactly as the same quoted literal (test_a_resolved_string_renders_as_the_same_literal). A parameter that is numeric by contract still takes a numeric string, as?page=2read fromrequest.GETis (paginationpage/total_pages,progressvalue,form_arraymin/max,filter_searchdebounce,data_table's numeric options): the handler converts its own parameter. It takes ASCII decimal text of bounded length only (notinf,nan,1e999,1_000or non-ASCII digits): a parameter with a default falls back to it, the others refuse the value with the tag and parameter named. push_to_view()groups,scope=push scopes anddb_notifynow reach a view mounted over SSE (#3885). They are delivered through the channel layer, and an SSE session joined no group, so a page that fell back to SSE never saw them. Each SSE-mounted view (the page view and every view mounted beside it) now takes its own channel and joins and leaves groups through the same code the WebSocket uses (join_view_push_group,join_listen_channels,sync_push_scope_groups,leave_consumer_view_groups). Delivery applies the WebSocket's tenant stamp check, handler allowlist, own-echo skip (#1677) andreauth_on_eventre-check. A push that arrives whilemount()runs is applied after the mount frame, as on the WebSocket, and is discarded if the mount then fails or is refused. Adb_notifywaits for a busy view as long as the WebSocket's does (websocket._SERVER_TURN_LOCK_WAIT_S), then is dropped. A push from another process reaches an SSE session with a shared (Redis) layer. When the stream closes, the page navigates, a view beside the page is released or a mount fails, the view's channel leaves its groups; if the event loop has already stopped, the layer drops the memberships at itsgroup_expiry, as for a WebSocket consumer. A mount cancelled by a client disconnect now releases the view's server work (its tick, channel and groups). Tests inpython/djust/tests/test_sse_push_groups_3885.py.{% data_table %}accepts columns given as bare names on its first render too (#3895).columns=["name", "age"]was drawn by the native handler but raisedVariableDoesNotExistin the Python tag (the page's first render, under Django's engine). Any column that is not a dict (a name, a number,None, a bool) is now the column whose key and label are its text, on both engines; that text is plain even when marked safe (markup in a header is the dict form'slabel). The components guide no longer says aNoneor missing URL value still draws a link, and three remaining differences (NaN, amark_safecell, a model-instance row) are fixed below. New cases inpython/djust/tests/test_data_table_bare_columns_3895.pyandpython/djust/tests/test_data_table_residuals_3895.py.- A value marked safe for text is now always escaped when written into an attribute by the
native component handlers (#3895).
form_array(an input'svalue) anddata_table(export and import formats, bulk-action keys, computed-column keys, filter and expression inputs, row classes, footer aggregation types, and the row and column keys) usedconditional_escapefor those attribute values, which keeps a marked-safe member, such as one in a tuple operand, as it is. New cases inpython/djust/tests/test_native_attr_escape_marked_safe_3895.py. {% data_table %}draws the same table on both engines for the remaining cases (#3895). The native handler (every render after a LiveView event) was handedrowsandcolumnsas JSON text, which loses four things the Python tag (the first render) sees; djust's engine now also hands the handler a list or dict operand that holds one of them, and both implementations read rows and columns through the same functions. A cell value marked safe by the developer keeps its markup after an event, as on first load (plain strings and lazy translation strings stay escaped; a lazy value resolving to a marked-safe string and astrsubclass with__html__are still honoured only by the Django-engine render; every attribute built from a row value is escaped, and a URL is checked whatever it is marked); a row whose keys are not all text ({1: "a", "1": "b"}) is read with its own keys, as Django reads it; a model instance row is read as djust serialises it, so an excluded field is an empty cell on both, and another object is read for the column keys;NaN/ an infinity is writtennan/infon both and is never a link; a function inside a column dict is ignored on both, with one warning naming the column; and a column given as an object or a namedtuple is read for itskey/label/widthnatively too. New cases inpython/djust/tests/test_data_table_residuals_3895.py.data_table: a row with no URL is no longer a link (#3895). A link column whose row value was missing,Noneor blank drew<a href="">(the current page) or<a href="None">, and arow_urlrow was clickable towards them. Both engines now draw the cell as plain text and the row as a plain row.{% for u in users|dictsort:key %}with the field name in a context variable rendered an empty loop over QuerySet andlist[Model]rows, because the rows held only the fields the template names. The JIT now resolves the variable from the render's context and adds the one column it names to each row (a key that changes between renders serializes its own column), so a key naming one of the model's own columns sorts as Django sorts. A key naming a property, a method or a relation path still renders an empty loop, and so does a column the serialization floor ordjust_exclude_fieldshides, or one adjust_serializable_fieldsallowlist leaves out, where Django sorts. A list of plain (non-model) objects passed throughserialize_for_templateand sorted by a variable key also renders an empty loop.- A row read whole and by field (
{% for u in users %}{{ u }}{{ u.pk }}{% endfor %}, a single model's{{ user }}{{ user.pk }}, or{{ g }}beside{{ g.name }}in a loop overu.groups.all) printed the row as a dict ({'pk': 1}) over QuerySet andlist[Model]rows. The template variable extractor now records a whole read and files__str__beside the fields, and the row serializers give such a row the identity map a serialized model carries (id,pk,__str__,__model__), so{{ u }}prints what Django prints and the row stays a model, not a dict, to the template. A condition, a{% with %}binding or iterating a list is not a whole read. dictsort:'a.b'(anddictsortreversed) looked the dotted key up as one key and rendered an empty loop; it is now resolved one part at a time, as Django's_property_resolverdoes, over dict rows, JIT rows and live objects.dictsortover a list reached through a relation ({% for u in g.user_set.all|dictsort:'username' %}) rendered an empty loop when no field of the inner rows was read beside the sort. The key is now filed for a nested list whatever else the template reads, anddocs/RUST_TEMPLATE_API.mdsays which lists carry it.dictsortwith a key naming a method or a related manager (dictsort:'get_full_name',dictsort:'groups') sorted the rows by the called value, where Django orders the uncalled objects, fails, and renders an empty loop. Such a key is now left out of a JIT row when nothing else in the template reads it, and a live object's method or manager is not a sort value. Keys Python cannot order (Nonebeside a value, text beside a number, dicts, two models) now render Django's empty loop too, while keys the engine has no comparison of its own for (aUUID, a lazy string) are ordered by Python's own comparison, and tuple and list keys are compared element by element as Python does. A key whose Python<is not a total order (sets) no longer risks failing the render: every row is shown, in an order that need not match CPython's. With one row Django renders it and djust still renders nothing for a method or manager key.- Item-key reads under
DjustTemplateBackendand{% regroup %}: adictsortin a parent template ({% extends %}) is now attributed, since the backend extracts JIT paths from the inheritance-resolved source, and a field read through a regroup's.listis filed on the regroup's source, so those rows carry it. params_form: a multi-select field the URL left out counted as supplied (#3922).SelectMultiple/CheckboxSelectMultiplesay they are never omitted from the data, so aclean()that wrote into such a field the URL left out had its value handed tohandle_params()instead of the field'sinitial, on the valid path and withparams_form_fallback = "fields". The key itself now decides, as it does for a checkbox. New cases inpython/djust/tests/test_params_form_initials_3922_3926.py.- The neutralisation of a refused hybrid-template URL now fails closed when it cannot make every way the value comes out allowed (it raises instead of printing the value unjudged), and the path plan has cases for a loop that runs twice, an
{% empty %}literal and a neutralisation that needs a second round. (#3925) - A
handle_params()or handler that mutated a mutable forminitialchanged the form class's default for later requests (#3926). Django'sField.__deepcopy__does not copyinitial, soparams_form's valid path,params_form_fallback = "initial", a replaced field in"fields"mode, andFormMixin.form_datahanded over the object stored on the form class. Each now hands over a copy (aninitialthat cannot be deep-copied is handed over as it is). New cases inpython/djust/tests/test_params_form_initials_3922_3926.py. - A
{% blocktranslate ... asvar name %}variable printed as{{ name }}in an attribute,<textarea>or<title>of a component's inline template is escaped exactly once: a context variable prints as Django prints it (Delete A & B, notDelete A &amp; B), and a marked-safe variable and the block's own text (the msgid, or a translator's msgstr) are escaped too, where Django prints them as they are, so markup in a catalog cannot end the attribute or the<textarea>. A name bound by{% cycle ... as x silent %}is now seen as bound. Where the slot may not read that block (the block inside{% if %}/{% for %}/{% with %}, the name bound twice,{% extends %}) or the slot is filtered, the text is still escaped twice. (#3938) - Background work queued in a turn whose explicit state save missed its
storage deadline never started (#3945). The deferred turn returned before
dispatching the
start_async()work its handler queued, and the catch-up turn that later commits and re-renders the view did not dispatch it either, so the page kept the old value until some other event happened to start the work. Theexposure-matrixbrowser flow hit this on slow CI runners as a 10 s timeout after "spawn". The catch-up turn now announces the queued work on its frame and dispatches it after its own commit. 3 regression cases inpython/djust/tests/test_deferred_save_with_async_work_3945.py, including one through a realWebsocketCommunicator. DjustTemplateBackendno longer warns at startup that the supportedOPTIONSkeyslibrariesandbuiltinsare unsupported; the unknown-key warning now runs after every supported key is read.dj-lockre-enabled a control the response had just rendereddisabled(#3975). The unlock ran after the response's patches and setdisabled = falseon every locked control; it now runs before them, with thedj-disable-withrestore (#3963), so the response has the last word. Tests intests/js/dj_lock_server_disabled_3975.test.js.LiveViewTestClient.mount()could not mount a routedModelFormMixinview, and said nothing (#3977). It never bound the route's kwargs and never ran the post-mount object check, so an edit view "mounted" withobject = Noneand no form.mount(route_kwargs=...)binds them beforemount()as the transports do, the object check now runs afterhandle_params(), and a denial raisesPermissionDenied(a transport answers 403 or apermission_deniedframe).follow_redirect()passes the destination route's kwargs, andLiveViewSmokeTest.view_configtakes"route_kwargs". A test that mounted an object-scoped view whose check denies now getsPermissionDeniedfrommount(). New cases inpython/djust/tests/test_testclient_routed_model_form_3977.py.- Multi-valued controls were still flattened to one value in the draft manager,
dj-model,_collectFormDataand thedj-auto-recoverenvelope (#3978). One shared reader now keeps a group of same-named checkboxes and a<select multiple>as a list and a radio group as the checked value (a lone checkbox stays a boolean): drafts save a list and restore each box from it (a draft saved as a boolean still restores), a radio's ownvalueis no longer overwritten by a restored draft,dj-modelon a checkbox group bound to one field sends the list of checked values, and_form_valuescarries the list. The form adapters (as_live_field,{% live_field %}) render aSelectMultiplefield as a<select multiple>with every value selected. Tests intests/js/multi_valued_controls_3978.test.jsandpython/tests/test_adapter_select_multiple_3978.py. Drafts are now saved with a format number; a draft saved before this change drops its radio-group and checkbox-group entries on load (the old format did not record which choice was made) and restores its other fields. - More bars draw under a strict CSP (#3979). The token bar
(
TokenCounterand{% token_counter %}), the meter's segments (Meterand{% meter %}), the data table's data bar and loading skeleton, the skeleton placeholders (SkeletonFactoryand{% skeleton_for %}) and the gauge's box (Gaugeand{% gauge %}) no longer write astyle="width:…"attribute, which astyle-srcwithout'unsafe-inline'refuses. They use the width classes{% progress %}uses (dj-progress-w-0…-100, rounded to a whole percent, now also incomponents-classes.css) andgauge--sm/--md/--lg. A meter segment with a custom colour still carries that colour as a style, and its legend swatch no longer writes an emptystyle="". The demo project's progress bars and the component best-practices example use a native<progress>. New cases inpython/djust/tests/test_progress_widths_csp_3979.py. - Free-form style values: checked, and an opt-in strict-CSP mode (#3979).
Every width, colour, height or grid placement a component writes from a
caller's value now goes through one helper,
djust.components.utils.style_attrs/style_value(lengths, colours, integers, ratios, grid lines and tracks, a few keywords; neverfixedorabsolutepositioning, az-indexwithin ±9999; a hostile value is dropped with one warning per property). By default the result is the inlinestyleeach component has always written, byte for byte, so nothing changes for an app without a strict style policy. WithLIVEVIEW_CONFIG["csp_strict"] = True(for astyle-srcwithout'unsafe-inline') components writedata-dj-styleplusdata-dj-style-<property>="<value>"instead, pages carry<meta name="djust-styles" content="attrs">in their head (the setting is project-wide), and a new client module (54-dj-style.js) applies the values withelement.style.setPropertyon such pages only (the meta is read from the server-rendered head, once), re-checking each value (allowlisted properties, nourl(,image,attr(,@,;, braces, quotes or comments, custom properties by kind), after every patch, morph, navigation and lazy mount, and removing a property when its attribute goes away. In strict mode{% djust_skeleton %}and the animated Tailwind progress bar ask for their rules withdata-dj-css(added through a constructed stylesheet) instead of an inline<style>block, and the native dropdown's popover placement is thedj-dropdown-menu__content--popoverclass. Percent fills ofdjust.components.ui.Progress,ProgressandRustProgresscarry thedj-progress-w-Nclass in both modes. Covered, on every render path (class, Django tag, Rust engine, native handler, Rust component): the ui progress bars, avatar, navbar logo, spinner, many-to-many checkboxes, dropdown popover, ttyd terminal, virtual list, table of contents, tree view, file tree, terminal colours, avatar group, presence avatars, expandable text, progress circle, masonry grid, data card grid, split pane, dashboard grid, sortable grid, resizable panel, scroll area, sticky header, rich text editor, map picker, data grid and data table widths and colour scale, kanban and meter colours, colour picker, calendar, cursors overlay, collab selection, aspect ratio, responsive image,{% theme_skeleton %}and{% djust_skeleton %}. The calendar event and collab-selection highlight rules incomponents.csssetbackground-color(a longhand) from their custom properties. New cases inpython/djust/tests/test_csp_free_form_styles_3979.pyandtests/js/dj_style.test.js. {% theme_progress %}and the admin bulk-action progress page drew their bar withstyle="width:N%", which a strict CSP refuses (#3979).{% theme_progress %}now draws the width with a class per whole percent,<css_prefix>progress-w-0..-100in the themingcomponents.css(as{% progress %}does since #3969), and the bulk-action progress page a native<progress>element; the wizard guide's hand-written bar is a<progress>as well.djust.components.ui.Progressand the other inline widths the issue lists are not changed yet. New cases inpython/djust/tests/test_progress_widths_csp_3979.py.WizardMixin.on_wizard_complete()was handed field names no step declares (#3982).validate_field/update_step_fieldstore any name the page sends, and the complete hook received all of it whileon_step_saved()received each step's declared fields only. Both hooks now receive each form step's declared fields;wizard_step_datastill holds what was stored. New cases inpython/djust/tests/test_wizard_steps_hook_3982_4011.py.- A patch no longer moves focus to the page's
[autofocus]element (#3987). After every applied patch the client focused the first[autofocus]element on the page: a field being typed in receivedblurandfocusouton each update, and a clicked button lost focus to the autofocus field. Only an[autofocus]element the patch itself inserts is focused now, and never while the user is in a form field. A text or attribute update no longer queries for[autofocus]at all. state(persist="client")survives a reconnect (#3988). The signed token the client holds was sent back only on navigation, so a field declaredpersist="client"reset whenever the WebSocket or SSE connection dropped and came back. A reconnecting page view now sends the token with its mount frame on both transports; the server validates it as before.handle_restore()runs when an explicit view's declared state is restored on a reconnect (#3989). A view that persisted a loading flag withstate(persist="server")came back from a reconnect or a worker restart still showing its background job as running, with no place to clear it: the job does not survive the reconnect, andmount()runs before the restored state is applied. The hook ran only for legacy views (on a snapshot restore and on the HTTP fallback). It now runs wherever an explicit view's declared state is put back: a WebSocket or SSE mount, the HTTP fallback, and an embedded{% live_render %}child, each time aftermount()with the restored values in place. The loading-states guide shows the pattern.- A hook's
pushEvent()is acknowledged, and its reply can no longer resolve another event (#3990).pushEventbuilt its own frame with noref, so the server's reply could be matched to an unrelated pending event and the hook got no acknowledgment. It now goes through the transport's event path and returns a promise that resolves with the server's reply (ornullwhen the event was cancelled or there is no live connection). - The scripts djust loads carry the CSP nonce (#3991). The client script, extension
scripts and the DEBUG scripts were emitted as
<script src>tags without the request's nonce, while the inline scripts beside them had it. Under a nonce-only or'strict-dynamic'script-srcthe browser refused them, so the client never loaded. All four kinds of tag now carry the nonce when the request has one. - A hook registered by a later script is mounted on load, without a warning (#3992). The first hook sweep ran before a script after the client (an official adapter such as the Chart.js one, or an app's own deferred script) had registered its hook. It logged "No hook registered" on every page load and left the element unmounted until a later update. The first sweep now retries once when the document's deferred scripts have run, and warns only if the hook is still missing.
from djust import rate_limitworks as the decorator in every import order (#3993). Once the runtime had imported thedjust.rate_limitsubmodule, the name resolved to that module and@rate_limit(rate=..., burst=...)raisedTypeError: 'module' object is not callable. The submodule is now callable as the decorator, so the name works before and after the runtime loads it, whileimport djust.rate_limit as rl,importlib.import_module("djust.rate_limit")andfrom djust.rate_limit import Xkeep giving the module (re-binding the name to the decorator function, asdjust.live_viewis, would have broken those). New cases inTestImportFootprintinpython/djust/tests/test_lazy_package_init_2559.py.djust.V005,LiveViewTestClient.assert_allowlisted()andassert_all_routed_liveviews_allowlisted()now agree with the WebSocket mount (#3994). They matchedLIVEVIEW_ALLOWED_MODULESentries with a bare stringstartswith, while the mount matches on a dotted-segment boundary, so an entry such as"djust"passed every check for a view indjust_docs.viewsthat the mount then refused (the page rendered, and every event fell back to HTTP). All three now calldjust.security.mount.is_view_path_allowed. The demo project had fourteen routed views in that state; its allowlist now names their modules. New cases inpython/djust/tests/test_allowlist_segment_boundary_3994.py.{% djust_markdown %}works under Django's template engine too (#3994). The tag was registered for djust's own engine only, so a template rendered through Django's backend (the demo's/demos/markdown-stream/) could not parse it.{% load live_tags %}now provides it, calling the same sanitising renderer with the same options as the native tag, so the two write the same bytes for the same Markdown (script tags, raw HTML,javascript:links and nested emphasis included). New cases intests/unit/test_markdown_tag_both_engines_3994.py.- The demo project's pages render, connect and answer their first click
(#3994). Every routed demo URL, the
<int:pk>ones included, answers below 500 on an empty database and on a seeded one. Fixed: an exposure grant declared on a shared base (/demos/embedded-directives/), arender_full_template()override that droppedserialized_context(/demos/no-template/), the rentals tenant portal, tenant, property and maintenance pages (an empty-table.first(), filters on sliced querysets,Property.lease_set, arequestcontext key that theHttpRequestshadows, links with a pk the URL does not take, attributes a not-foundmount()never set), sixteen LiveView pages with nodj-root(they never connected), three templates whosedj-viewnamed a different class than the route, and dropdown items naming handlers the view did not have: the kitchen-sink split dropdown'saction1/action2(now handlers), and the twoaction='noop'items of the disabled dropdown inexamples/demo_project/djust_demos/views/rust_components_demo.py(removed: the view has nonoop).NavbarBadgeDemo, the one routed view indemo_app.views_old, moved todemo_app.views.homepage, so the unrouted legacy views stay off the allowlist. The twodocs/componentsnavbar examples now execute intests/test_doc_snippets_execute.py, which runs snippets without the demo's ownnavbarcontext processor. The pages are re-checked bytests/integration/test_demo_project_pages_3994.py. - A context processor's value that changes between turns now reaches the page, and one that does not change is no longer sent on every turn (#3996).
Every key a context processor adds used to look new on every render: its
plain-data values were converted and handed to the renderer again on each
turn, and because the same keys were left out of the changed keys, a value
that did change was stored but the template node reading it kept its old
text until a full render. Plain data from a processor (strings, numbers,
lists and dicts of them) is now compared with the last render like any other
context key: unchanged, it is not sent; changed, it is sent and the nodes
that read it are rendered again, on WebSocket, SSE and the HTTP fallback, and
on a bound component's scoped render, which now takes the page render when a
processor value changed. What #1786 kept out stays out: the request,
user,perms, the messages storage and lazy objects are never fingerprinted, stored or reported, andcsrf_tokenis still not a changed key. The serialisability check no longer callsjson.dumpson objects it can reject by type. Not done: memoising the theme preset list. The registry has no generation counter and presets are mutable objects written from several places, so a memo could not be invalidated reliably.python/djust/tests/test_per_turn_invalidation.py,python/djust/tests/test_per_turn_counts.py. escapejs,escapeand the routed filters now match Django where they did not (#4005).escapejsescapes the backtick (\u0060) and every control character below U+0020, as Django's table does; it left the backtick, which closes a JavaScript template literal, and most control characters raw.escapespells aDecimalorfloatasstr()does ({{ d|escape }}withDecimal("1E-9")is1E-9, not0.000000001).dictsort/dictsortreversednow raise where Django raises, where 2.0 rendered an empty string: an integer key over rows that are dicts (or a mix of lists and dicts) givesKeyError, a key whose__lt__raises propagates that exception, anddictsort:''raisesIndexError. They also sort a list of namedtuples by attribute.lastandrandomon a value that is not a sequence raise Django's own exception class (firstkeeps djust's own message for now). New cases inpython/tests/test_routed_cold_filters_4005.py.djust_exposure_inventoryno longer suggestspersist="server"for a view that does not persist today (#4023). It suggestedstate(persist="server")for every instance attribute. A legacy view withoutenable_state_snapshotrunsmount()again on a reconnect, so following the suggestion made its attributes survive reconnects and put them in the session. The command now suggests plainstate(...), and suggestspersist="server"only for a legacy view that restores its state today (enable_state_snapshot = True, whichPersistentLiveViewsets). Each view's report line states which case applies, and the JSON output has apersists_todaykey. A view that relies on the HTTP POST fallback restoring its state from the session still needs the grant added by hand.self._async_pending = (fn, args, kwargs)is refused instead of silently dropped (#4031). 2.0 removed the readers of the 1.x single-task queue on purpose (#3515), but the assignment still succeeded: over a WebSocket the work never ran and nothing was logged, while the HTTP fallback (#3630) still read it and ran it. Assigning a truthy value now raisesImproperlyConfigurednamingstart_async()and@background, and logs the same message, on every transport; the fallback no longer reads the attribute. AssigningNoneis still allowed. The name is listed inREMOVED_INSTANCE_ATTRIBUTESinpython/djust/_removed_settings.py.- V006 and V008 no longer fire on explicit-exposure views (#4032). Both
warn that a value assigned in
mount()cannot be serialized, but anexposure_policy = "explicit"view never serializes a plain attribute, soself.pricing = PricingService()is the documented pattern there. The checks now resolve each class's policy from the imported class (an inherited or default policy counts) and skip explicit views; a class that is not imported is skipped when its own body states"explicit". Legacy views and classes that are not LiveViews are checked as before. Regression cases inpython/tests/test_checks_v006_v008_explicit_4032.py. - T020 reports a
data-*attribute a strict handler drops even when the parameter has a default (#4033). A strict handler receives onlydj-value-*attributes. T020 reporteddata-item-idfeeding a requireditem_id, but not one feedingitem_id: int = 0, where the handler runs with the default and the click silently does the wrong thing: the usual shape of a 1.x handler flipped to strict. It now reports that binding with the existing "rename data-item-id to dj-value-item-id" hint. Regression cases inpython/djust/tests/test_t020_strict_data_defaulted_4033.py. - A component tag's default event has a framework handler again (#4037).
After the component mixins were removed,
{% modal %}'sclose_modal,{% sheet %}'sclose_sheetand{% carousel %}'scarousel_prev/carousel_nextreached no handler unless the app wrote one. The descriptors now answer them, withopen_modal,open_sheet,close_dropdown,show_tooltipandhide_tooltip: each is an@event_handlermethod named in the component's newMeta.events, registered on the view likeMeta.event.scripts/check-handler-contracts.pynow reads thekw.get("x_event", ...)defaults of the block tags and the descriptors'Metaevents, so the modal and sheet defaults are checked. - A plain component in a view's class body was one object shared by every session (#4045).
A plain
Component(Badge,Ratingand the otherdjust.components.componentsclasses) has no descriptor, sobadge = Badge(...)in the class body madeself.badgethe same object in every session of the worker. Once it reached a template, one user's handler write (self.badge.label = request.user.email) showed in every other user's next render and in every later page load. The error raised for a component assigned inmount()sent users there ("declare it in the class body"). An explicit view now refuses the declaration with anExposureConfigurationErrorwhen the class is created, including one inherited from a mixin or base, and again at mount for a component assigned to the class later. The message names the working forms: a field,badge = state(default_factory=lambda: Badge(...)), supplied fromget_context_data(), or a component built inget_context_data(). The error for a component assigned inmount()now says the same for a plain component; for aLiveComponentit still says to declare it in the class body, where each view gets its own copy. Legacy views are not refused; the newdjust.V026system check warns about the same declaration there. - Interactive components work over the HTTP fallback under explicit exposure (#4046). A
DropdownMenuand a keyed collection of them answered every page-POST event with 400 "Component not found": each request built a new view whose menus had new random ids and an empty registry. A declared interactive component is now part of the view's exposure contract: its id is derived from its declaration (view class, attribute name and, for a row, its key and that key's generation), and the id the page carries has a tag, an HMAC underSECRET_KEY(andSECRET_KEY_FALLBACKS) bound to the session, user, tenant, route and tab; an id from another session, user, tenant, route or tab, a bare derived id and a malformed tag are refused alike. Its state (open, selected, the observation cursor; each row's generation) is a small record saved in the view's declaredpersist="server"envelope, with its binding, expiry and size limit;persist=Falseon the declaration opts out. One restore (djust._component_state.restore_component_state, throughapply_declared_state) and one lookup (resolve_component_target) serve the HTTP fallback, the WebSocket and SSE, so a reconnect also finds a menu as the last event left it, and an unmaterialized ADR-031 descriptor now falls through to the view's alias on the fallback as it does on the socket. Tabs: a row's generation changes only whensync()removes that key, and a save keeps the stored copy of the rows its view does not hold, so two tabs showing different rows of one route, a reload and Back/Forward leave each other's menus working. A genuine id whose row is gone gets the current page on the fallback (no action runs). That refusal lasts while the removal is what is saved: after a page load, after a tab that still held the row saves it, or when a row left the data without async()removal, an old id of that key answers again, and then only with the menu's own actions on the row that has the key now. A selection that is not an enabled item (and the other inputs a menu refuses) is answered as a refused event on every transport, 400{"error": "Event rejected"}on the fallback where it was a 500. Remembered rows of other pages that do not fit the size limit, or exceed 512, are left out of the save with one value-free warning per view class. A missing, expired or invalid record starts the menus frommount()and the event still routes; component records that do not fit the size limit are left out of the save (logged once) instead of refusing every turn. The parameter-contract manifest keys a component by the id the page carries, so the client's strict binding applies to these components. The catalogue's dropdown example and its page are no longer pinned to the legacy policy, and the guide's examples run through a page GET plus fallback POSTs again. State is per session and route, not per tab. New cases inpython/djust/tests/test_interactive_http_fallback_4046.pyandtests/js/interactive_wire_id_contract.test.js. - The AI schema and the MCP server no longer teach the 1.x attribute walk.
djust.schema(CONVENTIONS["public_private"], theget_context_data,state()and@computeddescriptions, the lifecycle and JIT examples and pitfall 7) and thepublic_querysetfix text of the MCPdetect_common_issuestool recommendedself.items = self._itemsfollowed bysuper().get_context_data(), which renders{{ items }}empty under explicit exposure. They now supply the name fromget_context_data()(#4048). - The abandoned-worker cap test no longer flakes under runner load (#4077).
test_a_worker_is_not_started_while_the_cap_of_abandoned_ones_are_alivecounts the workers the third POST asks for where workers are started, instead of reading a shared "started" event that a late start of an earlier, already abandoned worker could set. - The demo project's handlers are callable under the default strict mode and
keep their state over the HTTP fallback (#4086). Over a hundred demo handlers
named by a template (
dj-click,dj-input,dj-submit,dj-change) acrossdemo_appand the routeddjust_demos,djust_forms,djust_rentalsanddjust_docsapps had no@event_handler, so the default strict mode refused them (djust.T019); a dozen did not accept the parameters their event sends (djust.T020), and the chat demo's handler never received its message. The demos index pages named handlers their views did not have. Counters, toggles and lists those handlers read and change are declaredstate(..., persist="server")(djust.V029), and a persisted list a client can grow is capped, oldest dropped. The homepage app's six legacy views are explicit now, and so isCustomNavbarView. The demo CI gate also fails on any T019, T020 or V029 finding;djust_checkskips thedjust_*apps, sotests/integration/test_demo_declared_state_4086.pyruns those checks over every demo app and checks each template binding names a decorated handler. - The CI shard-balance pin skips in a local run instead of failing (#4089).
tests/test_ci_python_test_shards.py::test_shards_cover_current_collection_with_balanced_durationscollects the whole suite, which the local load guard refuses outside CI. Run directly withoutCI=1orDJUST_FULL_LOCAL=1it now skips with a message naming both variables, where it used to fail with the guard's refusal.make test-early,make merge-gates,make test-harnessand CI set the variable and run it. - A view with
persist="server"state under an unsupported session engine is reported, not a bare 500 (#4092). UnderSESSION_ENGINE = "django.contrib.sessions.backends.signed_cookies"such a view answered every request with a generic 500 and logged only "Protected view operation failed". The combination cannot be made to work safely (server state is kept server-side so it never travels in the cookie), so: new system checkdjust.C030reports it at startup, naming the supported engines (db,cached_db,cache,file); the runtime refusal isUnsupportedSessionEngine, anImproperlyConfiguredthat names the engine found and the supported ones and reaches the developer on the page GET and the HTTP fallback POST, as other exposure configuration errors do; and the socket transports' value-free log line keeps the reason for configuration errors. Cases inpython/djust/tests/test_server_state_session_engine_4092.py. LiveViewSmokeTest's fuzzer no longer reports a refused payload as a handler failure (#4093). It reported the built-inupdate_model(and every handler with astrparameter) as failing forfield=None, a list or a dict. The handler never ran: the shared parameter validator refused those payloads with the transports' standard invalid-parameter answer. The test client's validation refusal now carries the transports'validation_details, andtest_fuzz_handlers_succeedcounts only failures of a handler that ran. Cases inpython/djust/tests/test_update_model_field_param_4093.py.- System checks now check project apps whose name starts with
djust_(#4094). The per-class checks (V001,S005,T027, ...) treated everydjust_*module as djust's own code and skipped it, so a project app nameddjust_shopgot no view checks and the demo gate (scripts/ci_djust_check_demo.py) never saw the demo'sdjust_demos/djust_forms/djust_rentalsapps. "djust's own code" is now the packages the djust distribution ships (djust._framework_code), shared by the checks,djust_typecheckand the auth analysis. On the demo this surfaced a real bug, now fixed: the embedded directives demo'sreceivedvalue always rendered empty. Regression cases inpython/djust/tests/test_framework_code_4094.py. - Persisted state over its size limit is refused without breaking the view
(#4095). A change taking a view's
persist="server"fields overStateLimits(64 KB encoded, 10,000 values, depth 16) answered 500, and on a live connection every later event failed too, because the oversized value stayed on the view. The save is now refused before anything is written (StateLimitExceeded): the user gets an error naming the field and the limit (code="state_too_large", status 413 on the HTTP fallback) and later events work. On WebSocket and SSE the view goes back to the last saved state through the same function as the reconnect restore (sohandle_restore()runs), and what the refused handler queued (start_asyncwork, push events, flash, page metadata, deferred callbacks, navigation) is discarded. Saved state is per session and route, not per tab, so "the last saved state" is whatever any tab of the session last saved on that route. When an earlier turn's save was deferred and has not landed, the refusal is the reload error instead (and the pending catch-up is withdrawn), so that turn's change is never dropped silently. The limits are unchanged. Cases inpython/djust/tests/test_state_limit_refusal_4095.pyandpython/djust/tests/test_state_limit_rollback_4095.py. - Breaking for tests:
LiveViewTestClient.send_eventrefuses what the transports refuse, andstate_afterholds only the view's state (#4096).send_eventran a method without@event_handlerand reported success, although every transport refuses that event under the default strictevent_security, so a test could pass for a view that does not work. It now runs the transports' own check (websocket_utils._check_event_security, after the event-name check and before the rate limit and permission gates, in the WebSocket order) and raisesdjust.testing.EventRejectedError(aNoHandlerFoundError), or returnssuccess=Falsewithcode="event_rejected"underraise_on_missing=False.get_state(),state_beforeandstate_afterno longer list names the framework defines (request,template,login_required, ...), even when the project sets them (page_title, aFormMixinattribute): assert on those through the rendered output or the attribute itself (client.view_instance.page_title). Migration: decorate a test view's handler with@event_handlerif it is meant to be an event. Cases inpython/djust/tests/test_testclient_event_security_4096.py. - A slow state save no longer costs an event its update on a view with
persist="server"state (#4098). An explicit turn waited 150 ms for its save and then answered a transientstate_error("Your last change is still being saved"), followed later by a full-HTML catch-up, so one slow write (an fsync on a busy disk, a loaded process) lost the event's own frame; the demo's@cachebrowser test failed that way on CI. The default ofDJUST_EXPLICIT_STATE_SAVE_TIMEOUTis now 2 seconds (it was 0.15). A turn waits that long for its own save while holding the page's event lock, so events sent in quick succession all take effect in order, each gets its own frame, and storage ends with the last one, over WebSocket and SSE (the HTTP page-POST fallback already saved inside its request). The trade: while a turn waits, the page's later events wait, ticks anddb_notifyturns are skipped and pushes are queued, so a save slower than the deadline is still deferred (the transient error, one catch-up, the reload error after three deferrals in a row). Set the setting higher (up to 10) to keep more events' own updates on slow storage, or lower to answer sooner. Covered inpython/djust/tests/test_rapid_events_persisted_4098.pyandpython/djust/tests/test_slow_save_backpressure_4098.py, with a test-controlled gate inside the session store holding the save. - A WebSocket mount whose session no longer exists mounts fresh instead of
failing (#4102). Channels'
AuthMiddlewareStackreads the session at connect, and that read clears a key the store no longer has, so the mount looked cookieless and its state binding failed ("Protected view operation failed"). The socket's request now takes the key from the browser's session cookie, so the #3201 replacement session applies. The HTTP fallback already mounted fresh; SSE events after a lost session are refused, as after a logout. New cases inpython/djust/tests/test_lost_session_mounts_fresh_4102.py. - Saved state written a little "in the future" by another process is no
longer discarded (#4105). A reader refused any saved state (declared
persist="server"fields, the automatic per-tab state, client snapshots) whose whole-second write time was after its own clock, so a process even under a second behind the writer silently mounted from defaults. Up to 30 seconds of clock skew (CLOCK_SKEW_TOLERANCE) is now accepted, and state refused for being further ahead is logged with the skew. New cases inpython/djust/tests/test_clock_skew_tolerance_4105.py. - Form validation over the HTTP fallback: tested field by field against the socket (#4109).
A
FormMixinview validated one field at a time now has a differential test that compares the rendered form after every step over a real WebSocket and over the page-POST fallback: errors on earlier fields stay shown and a corrected field loses its error on both. The fallback test harness now sends the page load's tab id as the client does, so its form and plain-attribute scenarios are patched and end in the socket's DOM. ADR-038 D-e, thepersisted_form_input()docstring and the HTTP-only guide no longer say form errors and plain attributes are lost between requests. - Rows a view holds now show a handler's database write on every transport (#4112). Over WebSocket and SSE a QuerySet kept on the view (
self._rows = Model.objects.filter(...)inmount(), the documented pattern), a related-manager QuerySet held frommount(), or acached_propertylisting rows kept answering with the rows from before the write; 1.3 behaved the same. djust now records the tables each step of the view writes (any step: an event handler,async defor not,mount(),handle_params(),start_async/@backgroundwork,handle_tick(), a server push,handle_info(), the connection hooks, a component's handler; on any database alias) and the tables the view's own code and renders read (lazy foreign keys, prefetches, per-row queries and read-onlyWITHqueries included; djust's own session and user checks excluded). When both are known and share no table, nothing changes: a handler that only wrote elsewhere still answersnoop. Otherwise every QuerySet andcached_propertythe view holds, in containers at any depth with no size limit, is read again, once, before its next render, and the turn renders even if nothing else on the view changed. A write is known only in the exact single-table shapes the ORM emits; anything else (raw SQL with unquoted names,TRUNCATE,MERGE, aWITHcontaining a write, several statements), a read djust cannot follow (a function,ONLY,TABLEor a parenthesised join inFROM), held rows or a cached value filled outside the view's own steps and renders (a copied or unpickled QuerySet included), and a restored state make the decision "read everything again" (logged at DEBUG bydjust._held_rows). A model instance (its prefetched relations included) and a list of rows stay snapshots on every transport. Writes the database makes by itself (triggers,ON DELETE CASCADE, a model over a database view) cannot be seen:DJUST_REFRESH_ON_ANY_WRITE = Truemakes every write refresh, and the new Info checkdjust.C042names unmanaged models andDB_*cascades while it is off.self.rows_changed(*models_or_tables)marks the view by hand for a write made outside its steps (a thread or task the handler started, anon_commitcallback, another process); such a write shows on the view's next render, nothing is sent by itself. A sticky or embedded view whose neighbour wrote re-reads on its own next render. The mark is kept until a render of the view succeeds, and a mark made while that render ran survives it. Verified with SQLite and with PostgreSQL 15 (psycopg 3). KanbanBoard(the class component) leaves "+ Add card" out whenadd_card_eventisNoneor"", as the{% kanban_board %}tag does (#4120), and its docstring now says what it renders: its columns carrydata-col-id, its cards do not drag.djust.T012no longer warns on a function component's own template (#4121).@componenttakestemplate_name=: the component returns the template's context (orNoneto render it with the assigns) and djust renders the template, with its{% include %}held to the same template-call guard as aLiveComponent'stemplate_name(#3880). The check reads the registry and treats such a template as a partial, as it does an{% include %}d one; a template no component names still gets the warning.- A LiveView template whose wrapper opens in one
{% if %}…{% else %}and closes in another renders (#4122). Thedj-rootextraction balanced<div>s across{% if %}branches and, after an{% else %}reset the depth, took the wrapper's</div>inside the second{% if %}for the root's close. The truncated source then failed with a misleading "Unclosed tag 'if'" (or, with{{ block.super }}in the base, aBlockNodeerror). A close inside a branch is now read as the root's close only when no close outside a branch exists (as before);{% if %}tags inside{% verbatim %}or a comment no longer count as branches; and a root closed in every branch of an{% if %}…{% else %}({% if a %}A</div>{% else %}B</div>{% endif %}), whose else branch used to be cut off, is refused with aTemplateSyntaxErrorthat says to close the root once, after the{% endif %}. - A repeated query key reaches
handle_params()whole on every transport (#4125). For?tag=a&tag=bthe page GET and the HTTP fallback handedhandle_params()['a', 'b'], but the socket and SSE mounts,live_redirectandurl_changehanded it'b': the client built their params withObject.fromEntries, which keeps the last value. The client now sends every value of a repeated key as a list (a key given once is unchanged), the SSE stream view keeps them, and the request andurithe runtime builds encode them as repeated keys. Saved-state URL comparison now counts every value, so a change to an earlier value of a repeated key is a URL change.mount()and theon_mounthooks still receive a repeated key's last value on the socket and SSE mount, as in 1.3; onlyhandle_params()gets the list. Shipped client: +78 bytes gzipped. - The UI-state events component tags send by default have a framework answer (#4126).
{% lightbox %}(close_lightbox,lightbox_navigate),{% command_palette %}(close_palette),{% export_dialog %}(close_export),{% announcement_bar %}(dismiss_announcement),{% nav_menu %}(toggle_nav),{% expandable_text %}(toggle_expand),{% truncated_list %}(toggle_list),{% markdown_textarea %}(toggle_preview) and{% stepper %}/{% wizard %}(set_step) were refused as "Event rejected" unless the application wrote a handler. Nine new components indjust.components.descriptors(Lightbox,CommandPalette,ExportDialog,AnnouncementBar,NavMenu,ExpandableText,TruncatedList,MarkdownTextarea,Stepper) answer them, asModalandSheetdo since #4037: declare one on the view and pass its state to the tag.manage.py checknow reports, asdjust.T019, a tag in a view's template whose event nothing on the view answers (a{% modal open=show %}with noModal()and noclose_modalhandler; a{% cookie_consent %}without anaccept_cookieshandler), naming the tag and what answers it; it covers{% modal %},{% sheet %},{% carousel %},{% tabs %},{% accordion %},{% dropdown %}and the tags above. It also reportsclose_event=None(orFalse,""): a tag has no off state, so it still draws the control, sendingNone, and every click is rejected.Carousel()withouttotallogs a warning on the first click that cannot move it;Stepperrefuses (and warns once about) a step it cannot apply, such as a{% wizard %}step id when declaredStepper(active=0)(the check's hint saysStepper(active="<first step id>")for a wizard), a negative index or a boolean;Lightboxtakes an optionaltotalso previous and next wrap, and without it refuses a negative or absurdly large index. Two components of one type on a view needcomponent_id=on each tag, which the nine new components' tags do not take yet (#4134).scripts/check-handler-contracts.pyno longer lists these events as application actions;accept_cookiesandpalette_searchstay the application's, and the pushed (stream_chunk,data_loaded) and browser (section_changed) event names are not scanned, since none reaches the view. "Events a tag sends" in the components guide lists each tag's events and what answers them. - A form reset reaches the browser on the turn that asked for it (#4129). A
reset_submitted_form()(orFormMixin.reset_form()) in a turn that renders nothing (skip_render(), a deferred or component turn) was dropped from that turn'snoopand applied by some later, unrelated render; thenoopnow carriesreset_formand the client applies it on the socket and SSE. The HTTP fallback never sentreset_format all; its answers now carry it. live_views()anddjust_auditleave out the views djust ships, whatever imported them (#4129). Whether a class in a djust module is user-shaped is read from the module's dotted path (atestsorexamplespackage, or atest_*module), not from the substring "example": the menu demo indjust.components.interactive_exampleswas listed as a project view once anything had imported it.make template-library-url-sweepno longer exits 1 on a cleanmain: the script now applies the same decided baselines aspython/tests/test_url_scheme_sweep_3665.py(both readUNJUDGED_PASSTHROUGH/KNOWN_AUTHOR_NAMEDfromscripts/lib/template_library_parity/url_sweep.py), lists decided holes asDECIDEDunder--verbose, and exits 1 only for an undecided hole. The sweep's scanner now treats asrcsetas an image sink on every element (production's rule), and the test corpus drives the payloads--quickadds (js-upper,data-svg,srcset-comma,anchor). The components guide notes thatdata-*values are printed as given (escaped) and that a script navigating on one must validate it A decision excuses only itself: a listed parameter printed in its own attribute with the non-executing class decided (cite=incite,data_url=indata-url, a componentdata=key in adata-*attribute); the same parameter reaching<a href>or any other executing attribute is an undecided hole (#4130).- The last UI-state events component tags send by default have a framework answer, and every such tag takes
component_id=(#4134).{% dropdown_menu %}(toggle_menu),{% split_button %}(toggle_split_menu),{% sidebar %}(toggle_sidebar),{% notification_center %}/{% notification_popover %}(toggle_notifications),{% tree_view %}(tree_expand),{% alert %}/{% page_alert %}(dismiss_alert),{% toast_container %}(dismiss_toast) and{% date_picker %}(date_prev_month,date_next_month) were refused as "Event rejected" unless the application wrote a handler.Dropdownnow answers the two menu toggles, and six new components indjust.components.descriptorsanswer the rest:Sidebar(collapsed),NotificationCenter(is_open),TreeView(expanded, the ids of the open nodes, passed to the tag's newexpanded=argument),Alert(dismissed),Toasts(toasts, withshow(message, type=...)) andDatePicker(year,month).TreeViewrefuses a node id that is not a non-empty string (or integer) of at most 256 characters, and expanding past 10,000 nodes;Toastsignores an id that names no toast and keeps at most 50;DatePickerstops at the calendar's first and last month, and defaults its year and month each on its own, as the tag now does (one shared helper):DatePicker(year=2030)shows this month of 2030 and steps from it. Selecting a tree node, picking a date, marking a notification read and a menu item's action stay the application's, andmanage.py check(djust.T019) now reports these tags too. The tags of the nine components added for #4126 ({% lightbox %},{% command_palette %},{% export_dialog %},{% announcement_bar %},{% nav_menu %},{% expandable_text %},{% truncated_list %},{% markdown_textarea %},{% stepper %}/{% wizard %}) and of the tags above takecomponent_id=on both template engines, so two components of one type on a view can each be driven by their own tag; only the controls the component answers carry it, never one sending the application's event.{% bottom_sheet %}(close_sheet, answered bySheet) joins the table, withcomponent_id=. The native (socket-render){% accordion %}ignored itscomponent_id=, which the Django tag honoured; it now marks its own triggers (not a nested accordion's), and a standalone{% accordion_item %}renders as before. An event whosecomponent_idis not a string of at most 256 characters (a list raised an uncaughtTypeErrorfrom the lookup) is refused as "Event rejected" before the lookup, over the socket, SSE and the page-POST fallback.manage.py check's hint names the full import (from djust.components.descriptors import Alert), sincedjust.componentshas other classes of the same names. A component state field may be named after a dict method: a field nameditems(which hiddict.items, so saving the view's state crashed under explicit exposure) now works under explicit exposure too, asvalues,keys,copy,pop,clear,fromkeys,popitemandsetdefaultalready did, because djust reads a state through the unbound dict methods when it saves, encodes or walks it.getandupdateare refused with a clear error when the class is created: TypedState uses those two itself, so such a field never worked.scripts/check-handler-contracts.pyno longer lists the nine events as application actions. - A namedtuple held in LiveView state keeps its field names in the template (#4141).
normalize_django_valueturned every tuple into a list before the template saw it, so{{ cols.0.key }}was empty and a{% data_table %}whose columns are namedtuples drew them as lists once the view rendered from its state. It now rebuilds a namedtuple over its normalized members (the one rebuild the template serializer already used for #3849, shared asrebuild_namedtuple), so the page reads its fields by name and by index as Django does: on the first paint, after an event over the WebSocket, after a reconnect and after a fallback POST, with either exposure policy. Plain tuples and lists, and the session boundary, still cross as lists. New cases intest_namedtuple_state_render_4141.py. {% djust_markdown %}keeps the indentation of a source that opens with an indented code block (#4142). Both engines stripped the source before parsing, so Markdown whose first line was an indented code block was read as a paragraph. The strip was dropped on both engines by the 2.0-q train; this pins it: a source opening with four spaces or a tab, with or without blank lines around it, renders a code block on both engines, byte for byte. New cases intest_a_source_opening_with_an_indented_code_block_is_a_code_block_on_both.Component.update()no longer raises on a non-string__dict__key (#4143). It rebuilt a Rust-backed component's instance by walking its own__dict__and calledstartswithon every key; a key that is not astr(not an attribute name) raisedAttributeError. It now skips such a key, as every walk over a view's__dict__does since #4143. New cases inpython/djust/tests/test_component_update_non_string_key_4143.py.- The automatic state save no longer raises on a lone surrogate or a non-string
__dict__key (#4143). Astrholding a lone surrogate ("\ud800"), as a value or a dictionary key at any depth, encoded as JSON but not as UTF-8, so the save raisedUnicodeEncodeErrorand the turn failed. It is now left out like any other value the save cannot hold, on the WebSocket, SSE and the HTTP fallback alike: the response is served, one warning names the view and the field (never the value), and the next request runsmount()again; a private or component value is skipped quietly, as before. Saved bytes for every other value are unchanged. A key in a view's__dict__that is not astris not an attribute name: the save, change detection, handler discovery, the legacy context and snapshots, time-travel restore, component ids and the observability reset now skip it instead of raisingAttributeError. CI's benchmarks job also runs the #3997 turn-cost table's 3-round smoke form, so its check that every exposure setting answers with legacy's frames executes (--benchmark-onlyskipped it). New cases intest_automatic_state_unsaveable_text_4143.py,test_reset_skips_a_dict_key_that_is_not_a_stringandtest_the_turn_cost_smoke_runs_without_benchmark_only. - Safe-markup guard: the HTML-position check no longer re-judges a part once per path (#4145). The second pass's check for an HTML-only escaper written where that is not enough (#3864) asked the same question about the same part, after the same literal text, once for every path through the names and branches that reach it, so its cost grew exponentially with the branches that rebuild a string; the guard's differential fuzz (
python/tests/test_safe_markup_guard_3820.py, seed 1) went from 7 s to 113 s. Each answer is now remembered for the run under the part, its scope, the depth, the call bindings in force and the text in front of it, which is everything it depends on. The findings are unchanged: byte-identical on the audited tree and on the fuzz's generated programs (python/tests/test_safe_markup_misplaced_memo_4145.py). - An explicit-exposure sticky child survives
live_redirectto another page (#4149). Underexposure_policy = "explicit"the child was re-attached only when its reuse identity matched, and that identity included the request path and the parent's class, so a redirect from/a/to/b/dropped it and the destination mounted a fresh one; only a redirect back to the same route kept it. The destination's{% live_render ... sticky=True %}now re-attaches the preserved instance when the child class and itsstate()declarations, thesticky_id, the mount inputs, the nesting depth, the session, the user and the tenant match, whatever the route and parent class. The destination re-runs the child's authorization as before; the views it embeds move with it, each re-authorized against the destination request (if one is refused, the child is not carried). Theirstate(..., persist="server")fields are stored under the destination page in one session write, all or none. A child the destination refuses, or whose state cannot be stored, is discarded and the destination answers with an error frame; a destination that fails to mount discards every child staged for it. A discarded child is never re-attached by a later mount on the same connection. Unchanged: a baredj-sticky-slotstill does not re-attach an explicit child, a child mounted without a session or under a legacy parent is not carried to another page, and SSE keeps no sticky children for either policy. LiveView.render(), whichLiveViewTestClient.render()uses, now resolvesviewfor the form tags ({% live_field view "x" %},{% live_form view %}) to the view being rendered, asrender_with_diff()already did. Underexposure_policy = "explicit"the tags renderedERROR: View does not have as_live_field(), because an explicit view cannot putviewin its context; a legacy view only worked when it putviewin its context itself (#4151).- With
LIVEVIEW_CONFIG["worker_threads"]on, a server push to an explicit-exposure view now runs as one hop on the session's thread, as it already did for a legacy view: the turn is authorized against the current session inside that hop, before any hook, and a refused turn still runs no hook and closes the socket with4403. Saving the view's declared state stays a separate step before the frame; when it fails, the frame is withheld and the next update starts from what the browser last received. A view with anasync defcheck_permissionskeeps the previous path. (#4152) ModelFormMixinwithobject_recheck = "writes": underexposure_policy = "explicit"a read-only event (validate_field,object_read_only_events) now reuses the authorized record as documented. The explicit render caches the record's@propertyvalues on the instance (_djust_prop_cache), and the record's change check read that as a change, so every event ran the lookup and the permission check again. The check now leaves out the attributes that are not the record (_state,_djust_prop_cache); a changed field, a newly loaded deferred field and a changed foreign key still force the full check. The reuse is now also tied to the session and the tenant the record was authorized for, not only the user (#4153).{% live_render lazy=True %}no longer refuses an explicit-exposure child. The child mounts when its slot is filled, as a transient child: the fill reads the session and user from storage again, runs login andcheck_permissionsbeforemount()and the object permission after it, and requires the session, user, tenant and parent the page rendered under. A refused fill shows the samedenied accessmessage in its slot whichever check failed, including amount()that raisesHttp404orPermissionDenied; any other failure showsLazy child … failed.with no exception detail. The page still renders. The child may not declare persisted fields. (#4154)- A handler that wrote only
request.session(no view-state change) had its write dropped: over the WebSocket nothing was stored, and an in-place change (request.session["cart"].append(x)) was lost on every transport, because Django'sSessionMiddlewaresaves only a session markedmodified. In an explicit view the write, including an in-place change to a value the handler read, is now stored before the turn's reply over the WebSocket, SSE and the HTTP fallback, merged into the session as storage holds it, with or withoutDJUST_STATE_SAVE_INTERVAL; the same for a component's handler, a sticky child's handler, andstart_async()work. The work's write is stored with its result under the result's own authorization: a refused result (logout, revoked permission, another principal) stores nothing; work that raises after writing keeps the write, with or withouthandle_async_result(). A turn that does not write the session adds no session write. The HTTP fallback now tracks the request's session, for legacy views too: its saves merge, so a key another request stores meanwhile survives, at the cost of one session read per saving request (db: a state-changing turn goes from 3 to 4 SQL statements); a turn that assigns a session key makes two writes instead of one (djust's merged save, thenSessionMiddleware's); and an in-place change is now stored there, for a legacy view as well. Legacy views over WebSocket and SSE are unchanged: they save nothing after an event (#4162). - Django partials: Improve recursion and missing-variable exception parity.
- Reject wrappers that change the authenticated root namespace and commit the validated delivered HTML5 root as the HTTP diff baseline.
- Classify explicit child ownership using the same HTML5 root rules as VDOM parsing, including non-div roots and foster-parented markup, while retaining inert-content and nested-child exclusions.
- Django partials: Support authenticated LiveView roots rendered by partials, including caller context and inherited templates.
{% pagination %}no longer walks every page to choose the buttons it shows. The page list is the first and last page and the pages within two of the current one; it was found by iterating from 1 tototal_pages, so a very largetotal_pagesnever finished rendering. It is now computed directly, on the Django tag and the native handler alike.- Preserve authenticated page roots across opaque output later in the render without granting lazy-container authority. Carry root proof through page edits and validate final model bindings before advancing the delivered baseline.
- Defer embedded child mounts during full-page live-root updates until their authenticated HTML5 location is known. Skip page-shell and inert children, reject changed render occurrences, and recheck sibling locations after each child renders.
- Two view classes that a metaclass calls equal no longer share handler metadata.
The per-class handler plan table looked a class up by equality, so under a
metaclass defining
__eq__/__hash__(by name, for instance) one class's event handlers were listed for another class of the same name, including a hot-replaced one. The table is keyed by the class object's identity and every hit is checked against it. The exposure contract's per-class table, new in this release, is built the same way.python/djust/tests/test_per_turn_invalidation.py. - Template partials: Revalidate ordinary prepared-page roots after wrapper and client processing before committing their diff baseline, preserving authored root and model-binding provenance during normalization.
- Keep shared-room clock deadlines when timer tasks start late. The timer calculates its remaining delay when it runs, preventing a delayed task from postponing a due clock step.
- Bound large-state fingerprint work and avoid unnecessary rendering work. Oversized fingerprints conservatively invalidate, unchanged dynamic templates retain safe text-update state, and widget hooks can opt out of updates when their inputs are unchanged. The Chart.js adapter offers this opt-in and cleans up replaced canvases.
- A public view with explicit exposure was missing from an anonymous visitor's route map.
as_view()on an explicit view returns djust's error-handling wrapper around Django's callable. The route map that{% djust_client_config %}emits treats a wrapped callback as login-gated (it cannot tell what a decorator does), so every public explicit route was left out of the mapdj-navigatereads. The wrapper is now recognised by identity and looked through; a decorator applied around it still gates the route. - The page-POST fallback no longer reloads the page on its second event.
Each fallback request renders on a fresh server renderer, so every
whole-page answer is numbered v1; the client checked it against the previous
answer's version, saw a mismatch and, with no socket, reloaded the page. An
explicit view had this on every second event, and since the legacy render
cache was removed a legacy view does too. A whole-page fallback answer now
re-bases the client's version cursor, as a socket mount or
html_recoveryframe does; patch answers are still checked. New cases intests/js/http-fallback-whole-page-version.test.js. - The
djust newdemo view declaresitemsandsearch_querywithstate(..., persist="server"), so a fresh project passesmanage.py checkwithoutdjust.V029warnings and the to-do list survives the HTTP fallback.
Security
- Safe-markup guard: 32 of the 44 false negatives pinned by the review of #3848 are caught (#3850): a sink reached through
partial/map/getattr/ an attribute or container alias / a conditional alias /str.__new__(SafeString, ..)/ a callable instance / a class whose__html__returns itself, the format string offormat_html_join, the value a__html__method (or__str__of an@html_safeclass) returns, a dict key built from data and then iterated, a closure that fills the enclosing function's container, nested containers,for/withtargets that are subscripts,await/*argsas the argument,str.translate,(s % x) * n,html.escape(x, quote=False)and afrom x import *. The twelve still pinned each carry their reason inpython/tests/safe_markup_known_misses_3848.py; most use a developer-written literal as the payload, and a data twin of each is flagged. - Safe-markup guard: a sink handed a helper's call is judged with that call's arguments (#3864, #3845).
mark_safe(tag(safe_url(x)))ofdef tag(u): return f"<a href={u}>"andmark_safe(helper(x))of a helper that interpolates its argument were cleared: the guard judged the call only by its arguments. Such a call (of adef, a lambda bound once, or a method of a fresh instance of a plain class of the same file) is now also judged by what the function returns with its parameters bound to the call's arguments. The rule only adds findings by construction: the guard runs twice over a file, once as it was and once with the new judgement, sharing no state, and reports both; tests check the first pass against the recorded findings of the previous guard over a matrix of source x helper x placement, stress programs and the real tree, and the union against them too (python/tests/test_safe_markup_guard_3864.py,safe_markup_call_fuzz_3864.py). The mechanisms are turned off one at a time byscripts/safe-markup-call-binding-gateoff.json. - Safe-markup guard: an HTML escaper where HTML escaping is not enough is flagged (#3864).
escape/conditional_escape/html.escape/attr_textwere trusted in every position, somark_safe(f'<a href="{escape(x)}">')(ajavascript:URL has nothing to escape), an escaped value in anon*handler, a<script>or<style>body,srcdocor an unquoted attribute value were all cleared. The guard now reads the literal text in front of such an output in an f-string, a+chain,%andstr.format, written in place, held by a name or bound to a helper's parameter, and flags those positions (the start of a URL attribute's value,data-hrefincluded; a URL escaper's output in the code positions too). A<script type="application/json">data block is not a script body. It only adds findings (the second pass of the guard asks; the first is unchanged) and flags nothing in the tree. Still not seen, and pinned as such: the result of a helper placed in a larger string, ajoinor container, a value behind a part the guard cannot read, an HTML escaper between attributes or as an attribute or tag name, and anything in astyleattribute (python/tests/test_safe_markup_html_context_3864.py, gate-off listscripts/safe-markup-html-context-gateoff.json). - Safe-markup guard position and class-attribute checks (#3864): a balanced attribute fragment is exempt only when EVERY
safe_url/safe_css_*output in it sits inside a quote it opens (a second output after the quote closed emitted a live attribute);cls.X/C.Xof a class with a metaclass is no longer trusted; class attributes of Django class-based views and forms are treated as defaults (View.__init__sets everyas_view()keyword); and the command-line entry passes the keyword-writing classes it finds. Still not seen, and documented: an unreadable prefix, a helper that takes the escaper output as a parameter, and monkeypatching from outside the file. - Template-call guard refusal log (#3928): the once-per-type WARNING for a refused
renderis bounded least-recently-seen first, so a new refusal past the 256-key bound is still logged instead of dropped for the rest of the process; aSimpleLazyObjectis keyed on the type it wraps; and only an exactstris used for a type's module and name (a non-str, astrsubclass or a metaclass that raises on the read becomes?; a control character is escaped), so a class cannot make the refusal raise or forge a second log line. - Child-render
{% include %}guard (#3931): a patch ofIncludeNode.rendermade by someone else (a replacement, or afunctools.wrapswrapper of Django's own put in place before the first scope) no longer switches the guard off for the process: the next scope entry puts the guard over it (only the outermostrenderis trusted, so afunctools.wrapswrapper that names the guard but calls Django's ownrenderis held to it too) and the guard delegates to it. A replacement whose__wrapped__raises no longer makes every scope entry raise, and the "guard is not in place" WARNING is gone. Still open: a patch swapped in while a scope is active is unguarded until the next scope entry (pinned by a test). The census of Django-engine renders also seesgetattr(t, "render"), an unboundTemplate.render(t, c), a template held onself, and walrus, tuple-unpack, annotated, loop andwithbindings. - Password fields are kept out of drafts, the
dj-auto-recoverenvelope and_collectFormData. A field withtype="password", or markedautocomplete="new-password"/"current-password", is no longer saved to browser storage by the draft manager (even when the page marks itdata-draft="true"), sent back to the server bydj-auto-recover, or written to from a stored draft. Tests intests/js/secret_fields_not_kept_3978.test.js. - A value marked safe for text is now always escaped when written into an attribute by the
component template tags, the native component handlers, the theming tags and their templates
(every theme pack), the component classes and
{% djust_pwa_head %}(#4009, completing it). These wrote a tag or constructor argument intoclass,id,name,value,aria-*,data-*,dj-*,onclickand similar attributes withconditional_escape(or{{ x }}in a template), which keeps a value marked safe (mark_safe,format_htmloutput) as it is. Attribute slots now useattr_text/escape, and|force_escapein the theming templates. Visible change: a value you marked safe is shown literally, escaped, when it lands in an attribute (class=mark_safe("a&b")now reaches the browser as the texta&b); in a text slot it still renders as markup. Both engines render the same. Also fixed: an id and the attributes that name it (aria-describedbyof{% modal %},{% combobox %}and{% rich_select %}; theid/forofForeignKeySelectandManyToManySelect) are escaped exactly once, so they match for an id containing&,"or<; and a caller'sonclick=on{% theme_button %}is escaped once, in the template. The per-argument sweep inpython/tests/test_marked_safe_attribute_sweep_4009.pydrives every tag of the swept libraries on both engines and under every theme pack, every component class, everyRust*component and every native handler (called directly), and fails on any attribute that receives such a value unescaped or an id and a reference to it that do not match. The safe-markup guard now flagsconditional_escapeoutput placed inside a quoted attribute value. - Marked-safe values no longer leave an attribute in
app_shelland the inclusion-tag templates (#4009).{% app_shell id=... class=... %}(the Python tag and its kept native twin) escapes both withattr_text, and thebadge,avatar,progress,pagination,tableandtoasttemplates escape every caller value written into an attribute withforce_escape(a marked-safeprogresslabel could break out ofaria-label). The rest of #4009 (166 component tags and nodes, measured by a new marked-safe attribute sweep that now also renders the inclusion tags through their templates) is pinned exactly bypython/tests/test_marked_safe_attribute_sweep_4009.pyand stays open. - Reconnect form recovery no longer keeps or re-sends password values
(#4078). The capture taken before a reconnect mount held a
type="password"field's value (or one markedautocomplete="new-password"/"current-password") in memory, wrote it back into the new markup and replayed it to the server. It now uses the one password check drafts,dj-auto-recoverand_collectFormDatause (#4067), so every path that keeps or re-sends form values applies the same rule. Hidden and disabled controls keep their existing treatment. New cases intests/js/form_recovery_secret_4078.test.js. - Constant inline styles and an inline script no longer need
'unsafe-inline'(#4139). The constants #3979 left inline, which a strict Content-Security-Policy refuses, are now thehiddenattribute or a class in every mode, with JavaScript off and at first paint: the data table's hidden triggers and import input ({% data_table %}on the Rust engine), the data grid's edit trigger, a collapsed{% file_tree %}/FileTreefolder, the connection-status bar and the scroll-to-top button (tag and class), an inactive pane of the plainTabsComponent, and the theme modal and dropdown (hidden, toggled byconnection-status.js,scroll-to-top.js,file-tree.jsand the themingcomponents.js). The Bootstrap variant writes thed-block(modal) andd-flex(navbar-collapse) classes unconditionally, in both modes. A clickable data-table row's pointer cursor (both engines), the dismissible Bootstrap badge's close button, the Bootstrap navbar's external link and the Bootstrap sortable table headers keep their inline style by default and usedata-table-row-clickable/dj-badge-close/dj-navbar-link--external/dj-sortable-thunderLIVEVIEW_CONFIG["csp_strict"]. The ttyd terminal's hook module registers itself and is loaded by its own hashed static URL (with the request's nonce when there is one) instead of an inline module script.{% djust_pwa_head %}and the theme context processor'stheme_switchercarry the request's CSP nonce, and all four Rust-engine PWA handlers (djust_pwa_head,djust_pwa_manifest,djust_sw_register,djust_offline_indicator) now pass the request, so their output carries it on that engine too; the switcher's inlineonclick/onchangehandlers are thedata-theme-mode/data-theme-preset-selectattributestheme.jshandles. The accessibility report's score no longer floats by an inline style.djust newprojects link<app>/static/<app>/app.cssinstead of an inline<style>and inlinestyleattributes. New:scripts/template-library-csp-sweep.py, which renders every tag on both engines and every component class in both modes and reports inline styles, inline script blocks without the nonce, inline event handlers andjavascript:URLs (djust's own handlers stay inline by default and are markers undercsp_strict, #4146); its test and one test per site are inpython/djust/tests/test_csp_constant_styles_4139.py, the client side intests/js/csp_constant_styles_4139.test.js. LIVEVIEW_CONFIG["csp_strict"]also covers inline event handlers (#4146). A Content-Security-Policy whosescript-srclacks'unsafe-inline'refuses everyon*=attribute, and no nonce can allow one. The strict-CSP switch is nowcsp_strict, one setting for styles and handlers (defaultFalse);csp_strict_styles, its name in #3979, is accepted as the same switch, and setting both to different values (inLIVEVIEW_CONFIGorDJUST_CONFIG) is the system check errordjust.C039. A project that sets onlycsp_strict_stylestherefore also gets the strict handler markup below: it is an alias ofcsp_strict, not a styles-only switch. By default nothing changes: NavBar's menu toggle (Tailwind and plain renderers) and the close button of{% theme_alert dismissible=True %}and{% theme_toast %}write the inlineonclickthey always have, byte for byte, and need no script. Undercsp_stricteach is a marker a static module handles from a listener ondocument, with the same behaviour: the toggle isdata-navbar-toggle/data-navbar-toggle-class, handled by the newpython/djust/components/static/djust_components/navbar-toggle.js, which a strict LiveView page loads with the client (with the request's nonce), so a navbar a later patch inserts works, and for which the navbar renders its own<script src defer>(NavBar(nonce=...)gives it a nonce); the close button isdata-theme-dismisson adata-theme-dismiss-rootalert or toast root, handled bypython/djust/theming/static/djust_theming/js/components.js, which{% theme_head %}loads (itstheme.jsandcomponents.js<script src>now carry the request's nonce when there is one, in both modes). Both listeners act only on djust's own markup: the toggle only toggleshiddenorshowon a menu inside its ownnav[data-djust-navbar], and the close button only removes its direct parent when that is a marked root. The new system checkdjust_theming.W005reports a strict page (a template with what it extends and includes) that renders one of those two tags under{% theme_head include_js=False %}without loading that script. A caller's ownonclick=on{% theme_button %}and theButtoncomponent is kept in both modes and documented (a strict policy refuses it; usedj_clickor a JS command);{% theme_button %}now escapes it even when it is marked safe, so a template literal such asonclick='go("a")'is one attribute (it closed the attribute at its first"on both engines). A caller who pre-escaped the value (mark_safe('go("a")')) must now pass the plain text ('go("a")'): the escaped form is escaped again. The CSP sweep renders that caller-suppliedonclick=; in strict mode it fails on any other handler, and by default on any handler but djust's four. Thedata_tablerow_urldocstring no longer describes an inline handler the table stopped writing in #3887. Security guide: "Inline event handlers".
Documentation
ModelFormMixinobject_recheck = "writes": the cost and theprefetch_relatedlimit of the record-unchanged test (#3983). The forms guide now says the test deep-copies the record (cheap for ordinary fields, tens to hundreds of milliseconds for a very largeJSONField), and that a record loaded withprefetch_relatedis never reused. Both are fail-safe: the event gets the full check.- The state-management pages teach djust 2.0 (#3994).
STATE_MANAGEMENT_API,_ARCHITECTURE,_COMPARISON,_MIGRATION,_QUICKSTART,_PATTERNS,_EXAMPLES,_TUTORIALand the phase-1 and phase-5 records no longer teach@optimistic/@client_state(removed by #4006): instant feedback isdj-loading.*attributes or a JS Command chain, and two values kept in step are set by one handler.IMPLEMENTATION_PHASE3.md, which only described@optimistic, is deleted. All eleven snippets that were pinned as failing intests/test_doc_snippets_execute.pynow run. - Seven documented examples that failed when copied now run (#3994). Five guide snippets
read an attribute or called a helper the block never defined (
declarative-ux-attrs,error-codes,hooks,http-api, and the multi-step wizard tutorial); the time-travel example's inline template had nodj-root; and the streaming tutorial importedrate_limitfromdjust, which resolves to a module once the runtime is loaded (it now imports fromdjust.decorators). Thehttp-apiexample called asubscribe_presence()that does not exist; it usesPresenceMixin.track_presence(). - A tested table of what survives a reconnect, a restart and a second process
(#4000). New guide, What Survives a Reconnect, a Restart and a Second
Process: for each kind of state and
feature (persisted and transient fields, URL parameters, forms, wizards,
legacy views, components, background work, ticks, streams, login, logout,
tenants, two sockets of one session,
push_to_view, presence, session engines) what happens on the next event, on an HTTP-fallback request to another process, on a WebSocket reconnect to another process and after a SIGKILL, plus session reads and writes per event. Every cell is proved by a test intests/integration/multinode/test_state_survival.pythat starts two real uvicorn processes sharing one session store and one channel layer, and the page is generated from those tests' metadata, so a cell and its test cannot disagree. Known gaps are pinned as they are: an in-memory channel layer or presence backend and a process-local session cache silently do not cross processes, and a process whose clock is behind the writer's discards freshly persisted state. - Migrating to djust 2.0 (#4022). A new guide,
docs/website/guides/migrating-to-2.0.md: moving a view to explicit exposure, making handlers strict, the names and settings 2.0 removes with their replacements, what is still to be removed, and what has no replacement. Every Python example runs under the snippet-executing test. The guide was tested by migrating an owner app with six LiveViews. - The documentation's view examples work under explicit exposure, the default. Examples
that set
self.xinmount()and read{{ x }}in a template now supply the name inget_context_data(); the 1.x idiomself.items = self._itemsinsideget_context_data()is replaced bycontext["items"] = self._items. The prose that said public attributes reach the template by themselves is corrected in the core-concepts pages, the API reference, the best-practices and security guides,docs/ai/,docs/llms-full.txt, the JIT serialization guide andCLAUDE.md. The HTTP-only guide's counter declaresstate(0, persist="server"), since on that transport each POST runsmount()again.scripts/check-doc-exposure.pyfinds a documented view that still relies on the attribute walk, andtests/unit/test_doc_exposure_check.pyand the executed-snippet test fail on one (#4048). - The system-check reference, the error-code guide's check sections, and the
removed-name tables are generated from one file per entry (#4080). A new
check adds one file under
docs/checks/(its ID frommake new-check-id FAMILY=V; seedocs/checks/README.md), and a removal adds a file underdocs/removed/2.0/;make generated-docsrebuilds the regions indocs/system-checks.md,error-codes.md,migrating-to-2.0.mdandAPI_STABILITY.md, so two changes no longer edit the same lines.docs/checks/registers every ID ever assigned, including the retiredC018,T015,V007,V011,V017andV020, and a test fails when code emits an unregistered, retired or reserved ID. The quick-reference table gains the 13 checks it was missing (C301–C502,V009,V010,S006,S008,T016,T026) and its stated count is now derived.scripts/import-generated-docs.pymoves entries someone added to those docs by hand back into the source files. @component(template_name=...)renders its template without a request (#4121): autoescaping is on, context processors do not run, and{% csrf_token %}renders nothing. The components guide says so.
Removed
Removed the three 0.x deprecations:
@event,LiveViewFormand the legacy theme module (#3500). Their removal floor was 1.1.0.@event(djust.event,djust.decorators.event): use@event_handler, which behaves the same.LiveViewForm(djust.LiveViewForm,djust.forms.LiveViewForm): subclassdjango.forms.Form. Form reactivity comes fromFormMixinon the view. Replaceget_field_errors_json()withjson.dumps(form.errors)andget_field_value(name)withform.cleaned_data/form.data.djust.theming.themes._legacyand the namesdjust.theming.themesre-exported from it (THEMES,get_theme,list_themes,Theme,Typography,Spacing,BorderRadius,Shadows,Animations,ComponentStyles): useget_design_system/get_all_design_systems/DESIGN_SYSTEMSfromdjust.theming.theme_packs.
Removed the dead accessibility flush (#3500).
LiveViewConsumerandViewRuntimeeach called_drain_announcements()/_drain_focus()at the end of every turn, behind ahasattrguard, but no djust class defines either method, so noaccessibilityorfocusframe was ever sent. Both frame types are also gone from the page-level frame set inpython/djust/_view_slots.py. Programmatic focus is unaffected: it goes throughJS.focus(...)andpush_commands.Removed dead wire-protocol paths (#3500).
- The
use_binarymsgpack patch branch inLiveViewConsumer: the flag was alwaysFalseand the client could not decode binary patches. Inbound binary frames (uploads, and msgpack-encoded inbound messages) are unchanged. - The inbound
presence_heartbeat,cursor_move,debug_panel_openanddebug_panel_closeWebSocket frames, which no client sends; they now get the usual "Unknown message type" error. The clientpingis still the presence heartbeat, andLiveCursorMixin.handle_cursor_move()is still called from the app's own event handler. With the panel frames gone, the_debug_panel_activegate on the DEBUG-only_debugpayload went too. djust.sse.DjustSSEEventViewand itssse/<session_id>/event/route (djust-sse-event). Post{"type": "event", ...}tosse/<session_id>/message/(DjustSSEMessageView), which the client has used since #1237.- The readers of the legacy single-task
_async_pendingattribute, which nothing set;start_asyncqueues into_async_tasks. - The
_push_events_flush_callbackfallback inflush_push_events(); the flush resolves throughview._ws_consumer, which the WebSocket transport always sets alongside it.
- The
Removed three kill switches and the duplicate flat settings (#3500). Startup now fails with an
ImproperlyConfiguredthat names the replacement when a project still sets one (python/djust/_removed_settings.py). It runs inDjustConfig.ready()rather than as a system check because ASGI servers do not run checks, and a silently ignoredDJUST_STATE_BACKENDwould drop to the in-memory backend in production.LIVEVIEW_CONFIG/DJUST_CONFIGkeystemplate_auto_call,virtual_keyed_opsanddjango_value_repr: the behaviour each one could switch off is now always on. Delete the key.DJUST_WS_COMPRESSION: useLIVEVIEW_CONFIG['websocket_compression'].DJUST_VDOM_CACHE_ENABLED,DJUST_VDOM_CACHE_TTL_SECONDS,DJUST_VDOM_CACHE_MAX_ENTRIES: use thevdom_cache_*keys ofLIVEVIEW_CONFIG['service_worker']. Checks C301–C303 read only those keys now.DJUST_STATE_BACKEND/DJUST_REDIS_URL: useDJUST_CONFIG['STATE_BACKEND']('memory'or'redis') andDJUST_CONFIG['REDIS_URL']. Theredis://URL shorthand for the backend setting went with the flat alias.- System check
djust.C018(LIVEVIEW_CONFIG keys removed in 1.3) is gone; those keys are still ignored. - The flag-default consistency script and its pre-commit hook are gone;
virtual_keyed_opswas the only flag it tracked.
Removed the 1.x module shims (#3500).
djust.template_backend: usedjust.template(ordjust.template.backend.DjustTemplateBackendinTEMPLATES). ATEMPLATESentry that still namesdjust.template_backend.DjustTemplateBackendnow fails startup with anImproperlyConfiguredthat names the replacement. Thedjust newanddjust initscaffolds emit the canonical path.djust.state_backend: usedjust.state_backends.djust._view_resolution.is_view_import_allowed: usedjust.security.mount.is_view_path_allowed.djust.simple_live_view.LiveView: useSimpleLiveView.
Removed
@reactive(djust.reactive,djust.decorators.reactive) (#3500). It never worked on a LiveView:LiveViewhas noupdate(), so the decorator raisedTypeErrorat class definition. On other hosts the decorated function's body was never called. Use a plain attribute (djust re-renders after every event handler) or@computed. Itsget_framework_schemaand MCPget_decoratorsentries are gone too.Removed system check
djust.T015(#3500). It flagged the pre-1.0data-djust-root/data-djust-viewroot attributes, which the runtime has not read since 1.0 and the 2.0 client no longer recognises at all. A template that still uses them gets T012 (dj-*directives with nodj-rootordj-view); rename them todj-root/dj-view.@optimisticand@client_stateare removed (#4006). Both recorded handler metadata that nothing in the shipped client read, so a decorated handler behaved exactly like an undecorated one.from djust import optimisticandfrom djust.decorators import client_statenow raiseImportErrornaming the replacement; delete the decorator.djust.__all__has 59 names anddjust.decorators.__all__19. The DEP-002optimistic_ruleson descriptor components are unaffected. ADR-020 (dj-island), which nothing implemented, is marked superseded by the JavaScript widget hook contract (#3656).djust.auth.social.social_auth_providersis removed (#4025). The context processor and thedjust.auth.socialmodule are gone; they had warned since 1.3. ATEMPLATESentry that still lists the processor fails startup withImproperlyConfigurednaming the replacement. Use{% auth_providers auth %}from{% load djust_auth %};auth.providersholds the same providers, withidin place ofname, and the icon from theauth_provider_iconfilter.The eight component mixins are removed (#4025).
AccordionMixin,TabsMixin,ModalMixin,CollapsibleMixin,SheetMixin,DropdownMixin,TooltipMixinandCarouselMixin, with their*Stateclasses, are gone fromdjust.componentsanddjust.components.mixins; they had warned since 1.3. Use the matching component indjust.components.descriptors, which answers the same events (#4037).ComponentMixin,TypedStateandDataTableMixinare unchanged. Migration table indocs/API_STABILITY.md, "Removed in 2.0.0".Removed the
event_security"warn"and"open"modes: a method without@event_handleris never a client event, on any transport (#4101). The WebSocket, SSE, runtime and test-client paths read the mode while the page-POST fallback always refused, with its own message, so one event behaved differently by transport. Every client-event path (WebSocket, SSE, page POST, component and sticky-child events,LiveViewTestClient, the DEBUGeval_handlerendpoint and time-travel replay) now callswebsocket_utils._check_event_securityand answers alike:"Event rejected"in production, and inDEBUGa message naming the method, its class (a descriptor component's own class, not its proxy) and@event_handler. OutsideDEBUGa name that does not exist gets the same answer as a refused one on every transport, so the answer does not reveal which methods a view has.LiveComponentTestClient.send_eventruns the same check and raisesEventRejectedError.LIVEVIEW_CONFIG/DJUST_CONFIGevent_securityset to"open"or"warn"(any case) fails startup withImproperlyConfiguredand the migration hint, and any other value except"strict"fails startup as unknown;"strict"(any case) is accepted and does nothing. System checkdjust.T019now always reports a binding to an undecorated method, andLiveViewSmokeTestno longer emits the #3126 "reachable but unfuzzed" warning, which only applied to the removed modes. The page POST's answer for a missing or undecorated method changes from"Event handler not found"to the WebSocket's. Migration: put@event_handleron every method a template binds, then delete the key.Removed the Tokio actor system and
use_actors.use_actors = Truemoved a view's state and rendering into a per-session actor in the Rust extension. It was experimental, WebSocket-only and could not run under explicit exposure. The whole path is gone: theuse_actorsview attribute, the actor branches in mount and event dispatch, theuses_actors/dispatch_actor_event/uses_actors_for_mount/dispatch_actor_mounttransport hooks,djust.validation.actor_handler_arguments, the Rustactorsmodule, anddjust._rust.create_session_actor,get_actor_stats,SessionActorHandleandSupervisorStatsPy. System checksdjust.V017(async strict handler on an actor view) anddjust.V020(interactive component on an actor view) reported only on actor views and are retired; the IDs are not reused.A
LiveViewsubclass that sets a truthyuse_actorsnow raisesImproperlyConfiguredwhen the class is created, naming the class; a value set on the instance or assigned to the class later raises the same error right aftermount(), over HTTP, WebSocket and SSE. Delete the attribute: the view runs on the standard runtime, which already runs one turn at a time per connection, andstart_async()/@backgroundcover work that should not block a turn.djust_auditno longer prints anActors:line or ause_actorsconfig key.The Rust extension no longer depends on
tokio,pyo3-async-runtimes,bincodeorparking_lot, so theRUSTSEC-2025-0141(bincode) entry inosv-scanner.tomlis removed.System check
djust.C027. It reported aview_state_in_sessionvalue that was not a bool, and is retired with the setting. Nothing emits it; remove it fromsuppress_checksorSILENCED_SYSTEM_CHECKS.System check
djust.V011(a sticky child opted in to state snapshots and its parent did not) is retired withenable_state_snapshot. Nothing emits it; remove it fromsuppress_checksorSILENCED_SYSTEM_CHECKS.Client compatibility branches for old servers and deprecated attributes (#3500). The client ships with its own server, so 2.0 drops the code that only served older ones or long-deprecated markup: the per-view mount fallback for servers without
mount_batch(pre-0.6.0); thedata.typefallback fornavigationframes without anaction; the JSONdj-paramsattribute (usedj-value-*; it is also gone from the AI schema and the static binding checks); the pre-1.0[data-djust-root]marker indj-layoutswaps (usedj-root); thewindow.LiveViewWebSocket,window.setCacheConfigandwindow.globalLoadingManagerglobals (use the same names onwindow.djust); and the no-opinitTodoItemsstub.Unread client bootstrap globals and the unused
debug-panel.min.js(#3500). The injected bootstrap script no longer setswindow.DJUST_DEBUG_VDOM,window.DJUST_WS_COMPRESSIONorwindow.DJUST_LOADING_GROUPING_CLASSES: no client code read them. Thedebug_vdomsetting still drives Rust VDOM tracing.scripts/build-client.shno longer minifies the debug panel, and the committeddebug-panel.min.js(138 KB, never served: DEBUG pages loaddebug-panel.js) is deleted.Dead
RustDropdown/RustInputimports indjust.components.ui. TheDropdownandInputsimple components tried to import Rust classes that the extension never registered, so the import always failed and both always rendered in Python. The try-imports and their_RUST_AVAILABLEflags are gone; rendering is unchanged.Nine more dead Rust try-imports in
djust.components.ui. The breadcrumb, button group, checkbox, list group, navbar, offcanvas, pagination, select and table simple components tried to import Rust classes the extension never registered, so the import always failed and they always rendered in Python or through their template. The try-imports and their_RUST_AVAILABLEflags are gone; rendering is unchanged.BREAKING: dict-style
block.superreads in a Python-bridged tag. Deprecated since 1.3. The lazyblocka bridged tag receives now answersblock["super"](anddict(block)) with aTypeErrornamingblock.super(), as Django'sBlockNodedoes, and no longer hasget,valuesoritems. None of these renders the parent. Usecontext["block"].super(). Django's own resolution ofblock.superis unchanged.BREAKING:
enable_state_snapshot. A legacy view could set it to have its whole public and private state saved to the session after every WebSocket or SSE event (with a coalesced trailing save on teardown) and restored in place ofmount()when the socket reconnected; a sticky child of such a page was saved under its sticky key. The attribute, that save, that restore and the sticky-child persistence are removed. A view that sets the attribute to a true value is refused withImproperlyConfiguredwhen the class is created and again on the mount path (an instance attribute, a class attribute assigned later, a mixin whose__init_subclass__skipssuper()). Declare the fields that must survive a reconnect withstate(..., persist="server"). The HTTP page-POST fallback still restores a legacy view's session state. See Migrating to 2.0.BREAKING: the legacy Rust render cache. A legacy-exposure view's compiled
RustLiveView(template, render state and VDOM baseline) is no longer stored in the state backend under the session and page and reused by the next request or reconnect; each view instance builds its own, as an explicit view always did.DJUST_CONFIG['STATE_BACKEND']still backs the interactive-component visibility ledger anddjust clear. The private helpers_refresh_cached_rust_view,_saved_state_keyand_get_cached_template_hash_slotare gone.BREAKING: legacy view state in the session. A legacy-exposure view's public state (
liveview_<path>), its components' state (liveview_<path>_components) and the__mount_workloading marker are no longer written to or read from the Django session. Each page-POST fallback request mounts the view again, runs the workmount()queued and applies the event, so state that lived only on the view (a "load more" offset, a form draft, an open dropdown) resets on every fallback POST, and an event addressed to an interactive component the previous request rendered is refused with 400 "Component not found", as it already was on an explicit view.handle_restore()runs only when an explicit view's declared state is restored. Declare the fields to keep withstate(..., persist="server"). See Migrating to 2.0.BREAKING: the legacy signed back-navigation snapshot. A view that set
enable_state_snapshot = Trueno longer has its public attributes signed and sent to the browser, and a token a 1.x server signed is refused. (The session save and restore thatenable_state_snapshotalso turned on are removed with the attribute; see its own entry.) Removed with it:djust.security.state_snapshot(sign_snapshot,unsign_snapshot,SNAPSHOT_SALT), theLiveView._restore_snapshot()override, thestrict=argument ofLiveView._capture_snapshot_state()andNonPersistableStateError. Importingsign_snapshot,unsign_snapshotorSNAPSHOT_SALTfromdjust.securityraisesImportErrornaming the replacement: declare the fields the browser may hold withstate(..., persist="client", client=True), whose token djust signs and verifies itself. Attribute access raises the sameImportError, sohasattr()on one of those names raises rather than returningFalse. A view class that defines_restore_snapshot()is refused withImproperlyConfigured(when the class is created, and on the mount path), since nothing would call it. See Migrating to 2.0.BREAKING:
PersistentLiveView. TheLiveViewsubclass that setenable_state_snapshot = Trueis removed. Importing it fromdjustordjust.live_viewraisesImportErrornaming the replacement, and so does reading it as an attribute (hasattr(djust, "PersistentLiveView")raises rather than returningFalse): subclassLiveViewand declare the fields to keep withstate(..., persist="server"). See Migrating to 2.0.BREAKING: private-attribute persistence. A legacy-exposure view's
_privateattributes are no longer saved in the Django session (liveview_<path>__private,__private_unsaved) by the page GET or the page-POST fallback, nor restored from it. The fallback runsmount()on every POST instead, which rebuilds them. Declare what must survive between requests withstate(..., persist="server").UploadMixinno longer records_upload_configs_saved: its replay went withenable_state_snapshot. See Migrating to 2.0.The unregistered
djust_components::pythonPyO3 module and the emptycomplex/layoutcomponent placeholders. The deletedpython.rsin thedjust_componentscrate defined a_rust_componentsmodule andRustInput/RustText/RustDropdown/RustTabswrappers that no build ever registered, so they were never importable.djust_coreis now built as anrlibonly; the extension has always been built fromdjust_live.BREAKING: JSX-style
<RustButton …/>component tags anddjust.rust_components. The template engine no longer renders<RustButton>,<RustInput>,<RustText>,<RustCard>,<RustAlert>,<RustModal>,<RustDropdown>or<RustTabs>tags; any<Rust…>tag is now a template error that says it was removed.djust.rust_componentsis gone too: itsButtonconstructor did not match the compiled class and raisedTypeError. Usedjust.components.ui.Buttonand the otherdjust.components.uicomponents, which keep their Rust renderers. Thedjust_components::uiRust module that backed the tags is deleted, anddjust_templatesno longer depends ondjust_components.BREAKING: the Rust kill-switch setters.
djust._rustno longer exportsset_virtual_keyed_ops,virtual_keyed_ops_enabledorset_django_value_repr, andRustLiveViewno longer hasset_template_auto_call/template_auto_call_enabled. What each one switched on is now unconditional:[dj-virtual]parents always get key-addressed VDOM ops,{{ value }}always renders as Django'sstr()does (the pre-1.2legacy_displayrendering is deleted), and LiveView templates always auto-call nullary callables.DjustConfig.ready()no longer sets the two process-global flags.BREAKING: the pure-Python fallbacks for a missing Rust extension. djust 2.0 requires its compiled extension.
import djustnow fails if it is missing, instead of warning "Performance will be degraded" and leavingrender_template,RustLiveViewand friends asNone. About 45 guarded imports that silently switched features off without the extension are now plain imports: template-tag, filter and library bridging, scope and i18n hooks, the render environment,{% markdown %}, JIT serialization, dj-model allowlists and the Rust-backed simple components.djust_doctorand the CLI health check still report a broken install. Thejit_serializationsetting still selects the non-JIT serializer.Two unused
djust._rustfunctions.django_value_repr_enabledhad no caller and is deleted.clear_scope_tagswas only called from Rust unit tests, so it is no longer exported to Python and stays as a Rust test helper.BREAKING:
LIVEVIEW_CONFIG['view_state_in_session']. The setting chose whether a legacy view kept its state in the session; nothing is kept now, so every value is refused withImproperlyConfiguredat startup, inLIVEVIEW_CONFIGorDJUST_CONFIG. Delete the key.
Deprecated
{% kanban_board %}'sadd_col_eventis deprecated (#4134). It has never drawn a control: the board accepted it and ignored it. Passing it now raises oneDeprecationWarningper process, and the board renders exactly as before. Use nothing in its place: leave it out, and draw your own "Add column" control that sends your view's event. Removed no earlier than 3.0.0.exposure_policy = "legacy"is deprecated. A class that states it raises aDeprecationWarningwhen it is defined (or, when the policy is assigned to the class afterwards, the first time a view of that class is constructed), once for each class that states it. The message names the class and the replacement: remove the line, declarestate()fields and supply the template's names inget_context_data()(explicit exposure). The value still works in the 2.0 pre-releases and is removed in 2.0.0. The views djust ships that state it (PersistentLiveView, the admin change list and change form,TtydTerminalView, the interactive dropdown example,@live_view) do not warn, and neither does a subclass that only inherits it from one of them.