Skip to content

Add manage.py run_site wrapping run-site CLI#2

Merged
mpasternak merged 1 commit into
chore/lint-format-pipelinefrom
feat/run-site-management-command
May 8, 2026
Merged

Add manage.py run_site wrapping run-site CLI#2
mpasternak merged 1 commit into
chore/lint-format-pipelinefrom
feat/run-site-management-command

Conversation

@mpasternak
Copy link
Copy Markdown
Member

Summary

  • New manage.py run_site management command that execvp's the run-site CLI orchestrator with run [forwarded args]. Lets users stay in the manage.py flow instead of context-switching to a separate binary.
  • Pre-launch hook prints a one-shot copy-paste block for CLAUDE.md / AGENTS.md if neither file contains the <!-- django-dev-helpers:agent-help --> marker. Pasting the block silences future runs (the marker is part of the block).
  • New DJANGO_DEV_HELPERS["claude_md"] settings: mode ("warn" default / "off"), files, marker — fully validated like the rest of the settings dict.
  • 11 new tests covering binary missing, arg forwarding, marker silencing across files, mode opt-out, no-files-yet hint, and config validation.
  • Docs at docs/run-site-integration.md.

Notes for reviewer

Test plan

  • uv run pytest -q — 104 passed (93 prior + 11 new)
  • uv run mypy src/django_dev_helpers — clean
  • uv run pre-commit run --all-files — clean (idempotent)
  • Smoke-test python manage.py run_site -- --no-browser --no-migrate against a real Django project with run-site installed

🤖 Generated with Claude Code

`manage.py run_site` execvp's the `run-site` CLI tool with `run` plus any
forwarded args (after `--`), so users can invoke the dev-stack orchestrator
without leaving the manage.py mental model. Pre-launch, the command checks
CLAUDE.md / AGENTS.md for an `<!-- django-dev-helpers:agent-help -->` marker
and prints the agent prompt block once if missing — silenced per-project
by pasting the marker into either file, or globally via
DJANGO_DEV_HELPERS["claude_md"]["mode"] = "off".

- New `claude_md` config section with `mode` ("warn" | "off"), `files`,
  and `marker`. Validated alongside the rest of the settings dict.
- New command at `management/commands/run_site.py` with REMAINDER
  pass-through (use `--` to forward options like `--port`).
- Spawn factored into `spawn_run_site()` so tests can patch it; production
  uses `os.execvp` so signals/tty pass through cleanly.
- Tests cover: missing CLI binary, args pass-through, marker-present
  silencing across both files, mode=off silencing, no-files-yet hint,
  and config validation for each new field.
- Docs at `docs/run-site-integration.md`.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@mpasternak mpasternak merged commit 7989469 into chore/lint-format-pipeline May 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant