django
- Repo stars 2,412
- License NOASSERTION
- Author updated Live
- Author repo debugpy
- Domain
- Other
- Compatible agents
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- Trust score
- 94 / 100 · audit passed
- Author / version / license
- @microsoft · NOASSERTION
- Token usage
- Lean
- Setup complexity
- Plug-and-play
- External API key
- Not required
- Operating systems
- Unspecified (assume cross-platform)
- Runtime requirements
- No special requirements
- Permissions
-
- Read-only
- Write / modify
- Env read
- Network behavior
- Local-only
- Install commands
- 26 variants
Profile is derived at build time from SKILL.md and install vectors. Subject to drift from author intent.
Heads up: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: django
description: Best practices for Django web development including models, views, templates, and testing. Apply…
category: other
runtime: no special runtime
---
# django output preview
## PART A: Task fit
- Use case: Best practices for Django web development including models, views, templates, and testing. Apply this skill when working with Django projects — models, views, URL routing, templates, forms, admin, and management commands. runs entirely locally. Works with Claude Code, Cursor, Cline and 23 more..
- Inputs: target material, constraints, expected output, and acceptance criteria.
- Evidence boundary: follow “When to Use / Project Structure / Models” and do not present inference as author intent.
## PART B: Execution result
- **01** The card summarizes the use case; runtime output centers on “Best practices for Django web development including models, views, templates, and testing. Apply this skill when working with Django projects — models, views, URL routing, templates, forms, admin, and management commands. runs entirely locally. Works with Claude Code, Cursor, Cline and 23 more.”.
- **02** When the source has headings, the agent prioritizes “When to Use / Project Structure / Models” so the result follows the author’s structure.
- **03** Typical output includes task judgment, concrete steps, required commands or file edits, validation, and follow-up options.
- **04** Risk context follows the fingerprint: read files, write/modify files, read environment variables; mostly runs locally; usually needs no extra API key.
## Running Rules
- read files, write/modify files, read environment variables; mostly runs locally; usually needs no extra API key.
- Validate with a small sample before expanding scope.
- Return the result, validation criteria, and next iteration options. The source does not require a stable slash command. After installation, invoke the skill by name and describe the task.
Name target files or source material, expected output, forbidden changes, and whether network or shell access is allowed. Permission fingerprint: read files, write/modify files, read environment variables.
Start with a small task and check whether the result follows “When to Use / Project Structure / Models”. Inspect diffs, logs, previews, or tests before expanding scope.
Confirm the final output includes a concrete result, evidence, and next action. If it stays generic, tighten inputs, boundaries, and acceptance criteria.
---
name: django
description: Best practices for Django web development including models, views, templates, and testing. Apply…
category: other
source: microsoft/debugpy
---
# django
## When to use
- Best practices for Django web development including models, views, templates, and testing. Apply this skill when worki…
- Use it when the task has clear inputs, repeatable steps, and validation criteria.
## What to provide
- Target material, scope, expected result, and forbidden changes.
- Whether network, commands, file writes, or external services are allowed.
## Execution rules
- Organize steps around “When to Use / Project Structure / Models” and keep inference separate from source facts.
- read files, write/modify files, read environment variables; mostly runs locally; usually needs no extra API key.
- Validate with a small sample before expanding the task.
## Output requirements
- Return the deliverable, key evidence, validation method, and next action.
- Mark missing information as unknown; do not invent commands, platforms, or dependencies. The author source anchors workflow facts; repository files anchor sources and commands; Fluxly only adds fit, limitations, and quality judgment.
skill "django" {
input -> user goal + target files + boundaries + acceptance criteria
context -> When to Use / Project Structure / Models
rules -> SKILL.md triggers / order / output contract
runtime -> no special runtime | read files, write/modify files, read environment variables | mostly runs locally
guardrails -> usually needs no extra API key + small-sample validation + diff/log review
output -> copyable result + checklist + next iteration
} Skill: Django
Best practices for Django web development including models, views, templates, and testing.
When to Use
Apply this skill when working with Django projects — models, views, URL routing, templates, forms, admin, and management commands.
Project Structure
- Follow the standard Django app layout:
models.py,views.py,urls.py,admin.py,tests.py,forms.py. - Keep each app focused on a single domain concept; avoid "god apps" with unrelated models.
- Use
settings/base.py,settings/dev.py,settings/prod.pyfor environment-specific configuration.
Models
- Always define
__str__on models for admin and debugging readability. - Use
Meta.orderingsparingly — it addsORDER BYto every query. Prefer explicit.order_by()on querysets. - Use database indexes (
db_index=True,Meta.indexes) for fields that appear infilter()/order_by(). - Prefer
CharFieldwithchoices(orTextChoices/IntegerChoices) over bare strings for constrained fields. - Use
F()expressions andQ()objects for complex queries to avoid race conditions and improve readability.
Views
- Prefer class-based views (CBVs) for CRUD; prefer function-based views for one-off logic.
- Always explicitly set
querysetor overrideget_queryset()— never rely on mutable class-level state. - Use
select_related()andprefetch_related()to avoid N+1 query problems. - Set
LOGIN_URLand use@login_required/LoginRequiredMixinconsistently.
Testing
- Use
pytest-djangowith@pytest.mark.django_dbfor database access. - Prefer
TestCaseorTransactionTestCaseonly when explicit transaction control is needed; otherwise use pytest fixtures. - Use
RequestFactoryorClientto test views without starting a server. - Use
baker.make()(model-bakery) or factories instead of manual model construction in tests.
Pitfalls
- Never do blocking I/O in async views without wrapping in
sync_to_async. - Avoid importing models at module level in
settings.pyorurls.py(circular imports). - Never store secrets in
settings.py— use environment variables. - Avoid raw SQL unless the ORM genuinely cannot express the query.
Decide Fit First
Design Intent
How To Use It
Boundaries And Review