Simplifies creating demo pages in django-mvp by using standardized view classes and template inheritance.

Install

mkdir -p .claude/skills/demo-views && curl -L -o skill.zip "https://agentskills.codes/api/skills/download/10300" && unzip -o skill.zip -d .claude/skills/demo-views && rm skill.zip

Installs to .claude/skills/demo-views

Activation

This is the description your AI agent reads to decide when to run this skill — the better it matches your request, the more reliably it fires.

Guide for creating demo views in the django-mvp Demo App. Use when adding new demo pages to showcase components, layouts, or features — covers view creation, template structure, URL wiring, and sidebar menu registration. Emphasizes single configurable view classes with .as_view() attribute overrides instead of duplicating views.
330 chars✓ has a “when” triggerlonger than Claude Code's old 250-char listing cap (fine on current versions)
Intermediate

Key capabilities

  • →Create demo views
  • →Wire URL patterns
  • →Register sidebar menus
  • →Configure layout variations

How it works

It standardizes demo page creation using configurable view classes and template blocks.

Inputs & outputs

You give it
Demo requirements
You get back
Configured demo view and template

When to use demo-views

  • →Adding new component demos
  • →Configuring layout variations for demo pages
  • →Wiring new URL patterns in the demo app

About this skill

Creating Demo Views for the Demo App

The demo/ app demonstrates django-mvp features. Each demo page follows a consistent pattern: one configurable view class, a template extending page_view.html, a URL pattern (with optional .as_view() overrides), and a sidebar menu entry.

File Locations

FilePurpose
demo/views.pyView classes
demo/urls.pyURL patterns
demo/menus.pySidebar menu items
demo/templates/demo/<name>.htmlPage templates
demo/templates/base.htmlProject-level base (extends mvp/base.html)

Step 1: Create the View

Static pages: subclass DemoTemplateView

A page that shows components or layout, with no model behind it, uses DemoTemplateView from demo/views.py. It is an MVPTemplateView that looks for the template under demo/ first and puts a Home crumb ahead of the page title:

class MyDemoView(DemoTemplateView):
    template_name = "my_demo.html"
    page_title = "My Demo"

One View, Many Configurations — Use .as_view() Overrides

Do NOT create separate view classes for minor variations. Define one view with configurable class attributes and pass the differences to .as_view(). Most static pages in the demo need no class of their own at all:

# views.py
theme_customization_demo = DemoTemplateView.as_view(
    template_name="theme_customization.html",
    page_title="Theme Customization",
    extra_context={"themes": DEMO_THEMES},
)
# urls.py — one class, several URLs
urlpatterns = [
    path("products/", ProductListView.as_view(), name="product-list"),
    path("products/many/", ProductManyPagesListView.as_view(), name="product-list-many"),
]

Only create a separate view class when it needs different methods or significantly different behavior.

View Patterns by Page Type

Use the package's own views, so the demo shows what a project gets:

PageBase classTemplate
Static pageDemoTemplateViewyour own, extending page_view.html
List or gridMVPListView, with a filterset for its search, sort and filterslist_view.html (the default)
TableMVPTableView from mvp.integrations.django_tables.viewstable_view.html (the default)
Create, update, formMVPCreateView, MVPUpdateView, MVPFormViewform_view.html (the default)
DetailMVPDetailViewdetail_view.html (the default)
DeleteMVPDeleteViewdelete_view.html (the default)
import django_filters

from mvp.filters import SearchFilter
from mvp.views.list import MVPListView


class MyFilter(django_filters.FilterSet):
    q = SearchFilter(fields=["name", "description"])

    class Meta:
        model = MyModel
        fields = ["category", "status"]


class MyFilterDemo(MVPListView):
    model = MyModel
    filterset_class = MyFilter
    page_lead = "Everything in the catalogue."

The page's title, lead and info text come from page_title, page_lead and page_info on the view.

Adding Extra Context

Use get_context_data when the template needs dynamic data. Always call super():

def get_context_data(self, **kwargs):
    context = super().get_context_data(**kwargs)
    context["sample_items"] = [...]
    return context

For static context, pass extra_context to .as_view() or set it on the class.

Step 2: Create the Template

Templates live in demo/templates/demo/. A static page extends page_view.html, which draws the page title and leaves the body to you.

Block Hierarchy

page_view.html (extends base.html → mvp/base.html)
├── title              — the browser tab title; defaults to the page title
└── content            — wraps <c-mvp.page>
    ├── page.header        — above the title; empty by default
    ├── page.content-wrapper
    │   ├── page.title         — the title row
    │   │   └── page.actions   — buttons at the end of the title row
    │   └── page.content       — the page body ← MOST COMMON OVERRIDE
    └── page.footer        — the toolbar at the foot of the page

The shell's own blocks (app.navbar.end, app.sidebar, app.footer, extra_js and the rest) come from mvp/base.html. The breadcrumb trail is drawn in the header from the view's get_breadcrumbs(), not from a template block.

Typical Template (override page.content)

{% extends "page_view.html" %}

{% block page.content %}
  <c-mvp.text muted>Some words about the demo.</c-mvp.text>
  <!-- demo content here -->
{% endblock page.content %}

When to Override Other Blocks

BlockOverride when...
page.contentAlways — the main demo content
page.actionsPage needs buttons in the title row
page.footerPage needs content in the bottom toolbar
page.titlePage needs to replace the title row (rare)
contentPage needs to replace the entire <c-mvp.page> structure (rare)
app (from mvp/base.html)Page needs to reconfigure the shell, such as its breakpoint (rare). Wrap {{ block.super }} in {% with %} rather than writing <c-app> by hand
extra_jsPage needs additional JavaScript
app.navbar.endPage needs extra navbar widgets (rare — the defaults come from MVP_CONFIG["layout"]["navbar"]["end"])

Template with Title-Row Actions

{% extends "page_view.html" %}

{% block page.actions %}
  <c-button text="Action" variant="primary" size="sm" />
{% endblock page.actions %}

{% block page.content %}
  <!-- content -->
{% endblock page.content %}

Step 3: Add the URL Pattern

In demo/urls.py, add the path. Import only what's needed:

from .views import MyDemoView

urlpatterns = [
    # ... existing patterns ...
    path("my-demo/", MyDemoView.as_view(), name="my_demo"),
]

For configuration variants, override attributes via .as_view():

urlpatterns = [
    path("my-demo/", MyDemoView.as_view(), name="my_demo"),
    path("my-demo/alt/", MyDemoView.as_view(variant="alt"), name="my_demo_alt"),
]

Step 4: Add the Sidebar Menu Entry

In demo/menus.py, add items using AppMenu.extend() or mutate existing groups. Read the sidebar-menu skill for full reference.

Adding a standalone menu item

AppMenu.extend([
    MenuItem(
        name="my_demo",
        view_name="my_demo",
        extra_context={"label": "My Demo", "icon": "star"},
    ),
])

Adding to an existing MenuGroup

Use AppMenu.get() to find a group and add children:

group = AppMenu.get("list_views")
if group:
    group.add(MenuItem(
        name="my_list_variant",
        view_name="my_list_variant",
        extra_context={"label": "My Variant", "icon": "circle"},
    ))

Creating a new MenuGroup for related demos

MenuGroup(
    name="my_demos_section",
    extra_context={"label": "MY DEMOS"},
    children=[
        MenuItem(name="demo_a", view_name="demo_a",
                 extra_context={"label": "Demo A", "icon": "circle"}),
        MenuItem(name="demo_b", view_name="demo_b",
                 extra_context={"label": "Demo B", "icon": "circle"}),
    ],
)

Checklist

Before considering a demo view complete, verify:

  1. ✅ View is DemoTemplateView or one of the package's own views, with page_title set
  2. ✅ Only ONE view class exists per feature (variants use .as_view() overrides)
  3. ✅ A static page's template extends page_view.html and fills page.content
  4. ✅ URL pattern added in demo/urls.py with a named route
  5. ✅ Sidebar menu entry added in demo/menus.py (standalone or within a group)
  6. ✅ View name in MenuItem matches the URL pattern name

When not to use it

  • →Non-django-mvp projects
  • →Projects without demo app

Prerequisites

LayoutConfigMixin

Limitations

  • →Requires LayoutConfigMixin
  • →Limited to demo app structure

How it compares

It uses single configurable view classes instead of duplicating views for variations.

Compared to similar skills

demo-views side by side with the closest alternatives in the catalog.

SkillInstallsUpdatedSafetyDifficulty
demo-views (this skill)05moNo flagsIntermediate
django-pro207moNo flagsIntermediate
python-configuration56moReviewBeginner
django-patterns38moNo flagsIntermediate

Try saying

Example prompts that trigger this skill in your AI assistant.

Search skills

Search the agent skills registry