Setup Python Django
| This documentation was generated with the assistance of AI. Please report any inaccuracies. |
Scaffolds a Django 6.1 project with uv and startproject, or brings an existing Django project up to date, and layers this catalog’s Python toolchain and a small, tested project skeleton on top.
Purpose
iru-setup-python-django runs uv init --bare, uv add and django-admin startproject config ., then post-processes the result:
-
A PEP 621
pyproject.toml(version = "0.1.0.dev0",uv_buildbackend) with Ruff (includingDJrules, Google docstrings), mypy strict with django-stubs, pytest-django, and coverage with an 80% floor and Cobertura XML atbuild/coverage/coverage.xml. -
A split settings package
config/settings/{base,local,test,production}.pydriven by fail-fast environment variables, plusconfig/env.py. -
Apps under
apps/:apps.accounts(custom user created before the first migration),apps.core(abstractTimeStampedModel,/healthzand/readyzprobes) and a samplecatalogapp (model,@transaction.atomicservice, admin, API). -
The API as Django REST Framework with drf-spectacular (default), Django Ninja, or none.
-
Fast tests on in-memory SQLite and, for PostgreSQL, an
integrationtier on a testcontainers PostgreSQL. -
WhiteNoise, Gunicorn (
gthreadon WSGI, oruvicorn_worker.UvicornWorkeron ASGI for Ninja), Sphinx API docs underdocs/api/, a multi-stage non-rootDockerfile,.dockerignore,compose.yaml(postgres:18, one-shotmigrate,app),.env.example, andsonar-project.propertieswhen Sonar is enabled. -
A browser UI tier for the server-rendered pages it ships (the Django admin), per the catalog’s UI contract (see Building user interfaces):
.ui-quality.yml, pytest-playwright and axe-playwright-python,LocaleMiddleware(so right-to-left renders for real), the sharedtests/ui/ui_screenshots.pyhelper and anAdminLoginScreentest that captures.ui-screenshots/across left-to-right/right-to-left x light/dark with an axe check. It is selected with-m uiand kept out of the fast tier and its 80% coverage floor; the template lives inreference/ui-tests.md.
The generated code is the first exemplar of the iru-django-code-one-task conventions, and every verification command is the one the CI workflows and the iru-python-* gate skills run. The skill announces whether it is scaffolding from scratch or updating an existing project and, per owned artifact that already exists, asks Update / Keep as is / Replace (or Stop) unless on-existing pre-answers. Replace is not offered for manage.py, settings, config/urls.py or apps.
Plugin
Shipped by the iru-python plugin of the ai-catalog marketplace (install with /plugin install iru-python@ai-catalog; see Plugins).
Invocation
/iru-setup-python-django
When called from iru-setup-python-repository, the resolved answers arrive as args key: value lines.
Inputs
| Argument | Required | Description | Default |
|---|---|---|---|
|
No |
Distribution name (lowercase kebab-case, also image and compose project name), snake_case identifier (names the default PostgreSQL database and user) and description. |
Repository directory name; asked |
|
No |
|
Asked (existing projects: read from |
|
No |
CPython minor (3.12 to 3.14) for |
|
|
No |
|
|
|
No |
|
|
|
No |
Shared pipeline vocabulary. |
Asked or derived ( |
|
No |
|
Asked; |
|
No |
|
|
|
No |
|
Derived: |
|
No |
|
|
Other keys (ci-tests, pages, publish, orm, and so on) are ignored. A Python project that is not Django (a FastAPI service, a library) stops the skill. An existing project with migrations on the default auth.User keeps its user model and skips apps.accounts.
Outputs
-
pyproject.toml,uv.lockand.python-versionwith all tool sections. -
manage.py,config/(settings package,env.py,urls.py,asgi.py,wsgi.py, andapi.pyfor Ninja),gunicorn.conf.py. -
apps/core/,apps/accounts/and, for new projects or on request,apps/catalog/with its API files and generated first migrations. -
tests/(conftest.py,factories.py, fast tier, andintegration/with PostgreSQL). -
.ui-quality.ymland the UI tier:tests/ui/ui_screenshots.py,tests/ui/conftest.py,tests/ui/test_admin_login.py(captures land in.ui-screenshots/screen/AdminLoginScreen/<state>--<direction>--<theme>.png, plus ana11y-report.jsonl); theuipytest marker, the Playwright dev dependencies andLocaleMiddlewarein the settings. -
docs/api/conf.pyand the API reference pages. -
Dockerfile,.dockerignore,compose.yaml,.env.example, andsonar-project.propertieswhen Sonar is enabled. -
A report: mode, per-component action (created / updated / replaced / kept as is / removed), resolved choices and server type, versions from
uv.lock,.ui-quality.ymlaction and accessibility level, each verification command and result (including the-m uitier: captures written, axe violations by rule id; unverified items such as Docker-dependent steps called out), and warnings (review identity and Sonar keys, never commit.envordb.sqlite3, production environment variables, migrations once per release, integration tests need Docker; the UI tier needsuv run playwright install chromiumand is unverified without a browser).
No .gitignore, workflows, CHANGELOG.md, README.md or Antora files are written; the orchestrator runs the dedicated skills for those next.
Execution flow
Dependencies
Invokes
None. It runs uv, docker and curl directly and reads its own reference/ files (project, settings, sample app and tests, DRF or Ninja, docs, Docker and Sonar templates). Step 13 runs the commands that the iru-python-* gate skills and the workflows call, without invoking those skills. The generated code follows the iru-django-code-one-task conventions.
Invoked by
-
Setup Python Repository — scaffold step, flavor django, via the
iru-isolated-skill-executoragent.
Source
SKILL.md on GitHub — the file this page was generated from.