Token导航 LogoToken导航TokenDH.com
前端设计权限需确认github未标认证来源可访问许可证需确认审计通过

django-templatesDjango templates 测试

Agent Skill

用于辅助 Python 项目开发、测试、依赖管理和常见框架工作流。它适合让 Agent 阅读 Python 代码、定位测试问题、整理运行命令、生成脚本或分析数据处理逻辑。使用时需要确认项目虚拟环境、依赖版本和测试入口;涉及执行脚本、读写文件、访问数据库或调用外部 API 时,应先明确运行目录和输入输出范围,避免误改生产数据。

总安装

717

周安装

29

GitHub Stars

126

下载量

225
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:django-templates(Django templates 测试)
来源仓库:https://github.com/kjnez/claude-code-django
仓库路径:skills/django-templates
安装命令:
npx skills add https://github.com/kjnez/claude-code-django --skill django-templates
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/kjnez/claude-code-django --skill django-templates

简介

用于组织 Django 模板结构,提供可复用的页面片段、组件和 HTMX 局部更新支持。

  • 适合在 Codex、Claude、Cursor、Gemini CLI 中帮助 Agent 规划 templates 目录、命名约定和继承关系。
  • 使用时需区分完整页面与部分模板,合理使用 partials 和 components 提升维护性。
  • 安装通过 GitHub 仓库,建议检查项目实际路径和静态资源配置,确保模板加载无误。
  • django-templates 属于前端设计类 Skill,可作为该场景下的辅助能力补充。

SKILL.md

Django Template Patterns

Template Organization

templates/
├── base.html              # Root template with common structure
├── partials/              # Reusable fragments (navbar, footer, pagination)
├── components/            # UI components (button, card, modal)
└── <app>/                 # App-specific templates
    ├── list.html          # Full pages extend base.html
    ├── detail.html
    ├── _list.html         # HTMX partials (underscore prefix)
    └── _form.html

Naming conventions:

  • Full pages: list.html, detail.html, form.html
  • HTMX partials: _list.html, _card.html (underscore prefix)
  • Shared partials: partials/_navbar.html, partials/_pagination.html
  • Components: components/_button.html, components/_modal.html

Template Inheritance

Use three-level inheritance for consistent layouts:

  1. base.html - Site-wide structure (HTML skeleton, navbar, footer)
  2. Section templates - Optional intermediate templates for sections with shared elements
  3. Page templates - Individual pages that extend base or section templates

Standard blocks to define in base.html:

  • title - Page title (use {{block.super}} to append to site name)
  • content - Main page content
  • extra_css - Page-specific stylesheets
  • extra_js - Page-specific scripts

Partials and Components

Partials are template fragments included in other templates. Use for:

  • Repeated content (pagination, empty states)
  • HTMX responses that replace portions of the page
  • Keeping templates DRY

Components are self-contained UI elements with configurable behavior. Pass context with:

  • {% include "components/_button.html" with text="Submit" variant="primary" %}
  • Add only to isolate context: {% include "_card.html" with title=post.title only %}

Custom Tags and Filters

When to create custom template tags:

  • simple_tag - Return a string value (e.g., active link class, formatted output)
  • inclusion_tag - Render a template fragment (e.g., pagination component, user avatar)

When to create custom filters:

  • Transform a single value (e.g., initials from name, percentage calculation)
  • Chain with other filters for composable transformations

Location: apps/<app>/templatetags/<app>_tags.py (create __init__.py in templatetags directory)

Anti-Patterns

Move logic out of templates:

  • Complex conditionals belong in views or model methods
  • Use user.can_moderate not user.role == "admin" or user.role == "moderator"

Use URL names, not hardcoded paths:

  • Use {% url 'posts:detail' pk=post.pk %} not /posts/{{post.id}}/

Use CSS classes, not inline styles:

  • Use class="error-message" not style="color: red;"

Handle empty states:

  • Always include {% empty %} clause in loops that might have no items

Integration with Other Skills

  • htmx-patterns - HTMX partial templates and dynamic UI
  • django-forms - Form rendering and validation patterns
  • pytest-django-patterns - Testing template rendering

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.14%
按下载量换算81

Claude

30.84%
按下载量换算69

Cursor

20.26%
按下载量换算46

Gemini CLI

9.58%
按下载量换算22

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

权限需确认

当前来源未能明确判断权限范围,默认进入异常复核队列。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills