microsoft/django
Best practices for Django web development including models, views, templates, and testing.
npx skills add https://github.com/microsoft/debugpy --skill django
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.Take microsoft/django from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.