What problem does it solve?
Heavy imports on the django.setup() path slow down every process in a Django project — web workers, Celery, Temporal, migrations, shell, and CI. This Skill provides the checklist and guardrails to defer heavy imports, wire signal receivers correctly, and avoid regressions caught by the startup-import-budget tests.
Core Features & Use Cases
- Import deferral guidance: Rules for keeping vendor SDKs, pandas/pyarrow/scipy, and Temporal/AI/ClickHouse imports function-local with
# noqa: PLC0415 instead of at module scope.
- Regression guard workflow: Instructions for handling failures in
test_startup_import_budget.py, including when to add entries to FORBIDDEN_AT_SETUP versus the setup import baseline.
- Trap checklist: One-line summaries of common pitfalls such as silent receiver loss, models vanishing from the registry, lazy-router merge conflicts, and phantom importtime costs from GC.
- Use Case: When adding a new signal receiver or a heavy dependency to a Django app, use this Skill to wire it from a light module at
AppConfig.ready() and confirm no new heavy import lands on the setup path.
Quick Start
Ask the assistant to review your new Django receiver or heavy dependency import against the django-startup-time checklist before committing.