SPAView

class djcrud.views.spa.SPAView(**kwargs)[source]

Bases: TemplateView

Full-screen SPA shell with server-rendered sidebar navigation.

Subclass and extend Media to load your client ES modules with Script (type="module"). djcrud/base_spa.html is the default template (unpoly_target = 'body' so menu links full-reload across shells). Set mount_element to the HTML your client bundle attaches to; the template renders {{ view.mount_element|safe }}.

default_template_name

base_spa.html under djcrud/.

Type:

str

unpoly_target

'body' — cross-shell navigation uses plain links.

Type:

str

tags

['navigation'] — appears in the sidebar menu.

Type:

list[str]

mount_element

Bootstrap HTML inside [up-main] (default #app div).

Type:

str

Constructor. Called in the URLconf; can contain helpful extra keyword arguments, and other things.

class Media[source]

Bases: SpaShellMedia

has_permission()[source]

Superuser-only until add_perm() grants access.

media

Merged Media for this view (shell + subclass).