Getting it into your agent
One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.
git clone --depth 1 https://github.com/holtwood/awesome-cursorrules-zhWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/rules/holtwood/awesome-cursorrules-zh/django-best-practices)<a href="https://agentmods.dev/rules/holtwood/awesome-cursorrules-zh/django-best-practices"><img src="https://agentmods.dev/badge/rules/holtwood/awesome-cursorrules-zh/django-best-practices/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/rules/holtwood/awesome-cursorrules-zh/django-best-practices"><img src="https://agentmods.dev/badge/rules/holtwood/awesome-cursorrules-zh/django-best-practices.svg" alt="Reviewed on agentmods" width="80" height="20"></a>What it costs to keep this loaded
Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00000 | $0.00418 |
| Opus 5.5 | $0.00000 | $0.00167 |
| Sonnet 5.5 | $0.00000 | $0.00084 |
| Haiku 4.5 | $0.00000 | $0.00042 |
Grade A, and why
django-best-practices scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.
A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.
Nothing flagged
None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.
What it actually says
- 使用 Django 的类视图(CBV)处理复杂视图,简单逻辑可使用函数视图(FBV)
- 数据库交互优先使用 ORM,除非出于性能需求避免编写原生 SQL
- 采用 Django 内置 User 模型与认证框架管理用户
- 使用 ModelForm / Form 处理表单与验证逻辑
- 严格遵循 MVT(模型-视图-模板)模式,保持关注点分离
- 合理使用 Middleware 处理跨切面需求,如认证、日志、缓存
- 在视图层做异常捕获,并定制 404/500 等错误页面提升用户体验
- 通过 Django Signals 解耦日志记录与错误处理
- 使用 select_related / prefetch_related 优化关联查询性能
- 利用缓存框架(Redis/Memcached)减少数据库压力
- 使用 Celery 处理耗时后台任务,或编写异步视图应对 IO 密集型操作
- 遵循 PEP 8 命名与代码风格,提高可读性与可维护性
- 将业务逻辑拆分到独立 App,保持项目结构模块化
- 使用 Django REST Framework Serializer 构建 JSON API
- 在 urls.py 中定义清晰的 RESTful 路由
- 启用 CSRF、防 SQL 注入、防 XSS 等安全机制,定期审计安全配置
- 使用 unittest/pytest-django 编写单元与集成测试确保质量
- 通过 WhiteNoise 或 CDN 优化静态文件服务
- 为关键字段添加数据库索引,监控并优化慢查询
- 遵循“约定优于配置”原则,减少样板代码并保持一致性
What this file has done since we first saw it
Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.
- 1mo ago First seen · 25 lines · 0 tokens per session scan A ec95f0147cc7
django-best-practices is a cursor rule published in the GitHub repository holtwood/awesome-cursorrules-zh (240 stars, last pushed 8d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 418 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-09-03.
Other cursor rules, from other repositories
salesforce-apex-cursorrules-prompt-file
Cursor rules for Salesforce development with Apex integration.
rails-cursorrules-prompt-file
Cursor rules for Rails development with basic setup.
kotlin-ktor-development-cursorrules-prompt-file
Cursor rules for Kotlin development with Ktor integration.
cypress-integration-testing-cursorrules-prompt-file
Cursor rules for Cypress development with integration testing.
cypress-accessibility-testing-cursorrules-prompt-file
Cursor rules for Cypress development with accessibility testing.
playwright-defect-tracking-cursorrules-prompt-file
Cursor rules for Playwright development with defect tracking.