Add manage.py run_site wrapping run-site CLI#2
Merged
mpasternak merged 1 commit intoMay 8, 2026
Conversation
`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>
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
manage.py run_sitemanagement command thatexecvp's therun-siteCLI orchestrator withrun [forwarded args]. Lets users stay in themanage.pyflow instead of context-switching to a separate binary.CLAUDE.md/AGENTS.mdif neither file contains the<!-- django-dev-helpers:agent-help -->marker. Pasting the block silences future runs (the marker is part of the block).DJANGO_DEV_HELPERS["claude_md"]settings:mode("warn"default /"off"),files,marker— fully validated like the rest of the settings dict.docs/run-site-integration.md.Notes for reviewer
run-siterequires a--separator (manage.py run_site -- --port 9000), perargparse.REMAINDERsemantics; this is documented and tested.os.execvpso signals and TTY behave correctly; tests patch thespawn_run_sitehelper instead of mockingos.execvpdirectly.chore/lint-format-pipeline(PR Add pyupgrade and django-upgrade hooks, enforce ruff-format in CI #1) so the diff stays scoped to the new feature. Once Add pyupgrade and django-upgrade hooks, enforce ruff-format in CI #1 merges, retarget this PR tomain.Test plan
uv run pytest -q— 104 passed (93 prior + 11 new)uv run mypy src/django_dev_helpers— cleanuv run pre-commit run --all-files— clean (idempotent)python manage.py run_site -- --no-browser --no-migrateagainst a real Django project withrun-siteinstalled🤖 Generated with Claude Code