一键导入
django
Best practices for Django web development including models, views, templates, and testing.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Best practices for Django web development including models, views, templates, and testing.
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Best practices for building CLI applications with Click including commands, groups, options, and testing.
Best practices for Flask web development including routing, blueprints, and testing.
Best practices for template rendering with Jinja2 including environments, filters, autoescaping, and security.
Best practices for numerical computing with NumPy including arrays, broadcasting, and vectorization.
Best practices for writing and organizing tests with pytest including fixtures, parametrize, and plugins.
Best practices for HTTP client usage with Requests including sessions, error handling, and timeouts.
| name | django |
| description | Best practices for Django web development including models, views, templates, and testing. |
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.
models.py, views.py, urls.py, admin.py, tests.py, forms.py.settings/base.py, settings/dev.py, settings/prod.py for environment-specific configuration.__str__ on models for admin and debugging readability.Meta.ordering sparingly — it adds ORDER BY to every query. Prefer explicit .order_by() on querysets.db_index=True, Meta.indexes) for fields that appear in filter() / order_by().CharField with choices (or TextChoices / IntegerChoices) over bare strings for constrained fields.F() expressions and Q() objects for complex queries to avoid race conditions and improve readability.queryset or override get_queryset() — never rely on mutable class-level state.select_related() and prefetch_related() to avoid N+1 query problems.LOGIN_URL and use @login_required / LoginRequiredMixin consistently.pytest-django with @pytest.mark.django_db for database access.TestCase or TransactionTestCase only when explicit transaction control is needed; otherwise use pytest fixtures.RequestFactory or Client to test views without starting a server.baker.make() (model-bakery) or factories instead of manual model construction in tests.sync_to_async.settings.py or urls.py (circular imports).settings.py — use environment variables.