diff options
| author | Carlton Gibson <carlton.gibson@noumenal.es> | 2022-02-08 12:38:43 +0100 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-02-11 12:23:26 +0100 |
| commit | d113b5a837f726d1c638d76c4e88445e6cd59fd5 (patch) | |
| tree | 37191ed160b698bfbf81559b56735d3e83fd7f92 /docs | |
| parent | f9ec777a826816e20e68021c0e73b5a76be650af (diff) | |
Refs #33476 -- Made management commands use black.
Run black on generated files, if it is available on PATH.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/django-admin.txt | 18 | ||||
| -rw-r--r-- | docs/releases/4.1.txt | 4 |
2 files changed, 22 insertions, 0 deletions
diff --git a/docs/ref/django-admin.txt b/docs/ref/django-admin.txt index a60c538331..793461c265 100644 --- a/docs/ref/django-admin.txt +++ b/docs/ref/django-admin.txt @@ -2050,6 +2050,24 @@ distribution. It enables tab-completion of ``django-admin`` and See :doc:`/howto/custom-management-commands` for how to add customized actions. +Black formatting +---------------- + +.. versionadded:: 4.1 + +The Python files created by :djadmin:`startproject`, :djadmin:`startapp`, +:djadmin:`makemigrations`, and :djadmin:`squashmigrations` are formatted using +the ``black`` command if it is present on your ``PATH``. + +If you have ``black`` globally installed, but do not wish it used for the +current project, you can set the ``PATH`` explicitly:: + + PATH=path/to/venv/bin django-admin makemigrations + +For commands using ``stdout`` you can pipe the output to ``black`` if needed:: + + django-admin inspectdb | black - + ========================================== Running management commands from your code ========================================== diff --git a/docs/releases/4.1.txt b/docs/releases/4.1.txt index 6dd36e498c..88d283ff65 100644 --- a/docs/releases/4.1.txt +++ b/docs/releases/4.1.txt @@ -226,6 +226,10 @@ Management Commands * The new :option:`migrate --prune` option allows deleting nonexistent migrations from the ``django_migrations`` table. +* Python files created by :djadmin:`startproject`, :djadmin:`startapp`, + :djadmin:`makemigrations`, and :djadmin:`squashmigrations` are now formatted + using the ``black`` command if it is present on your ``PATH``. + Migrations ~~~~~~~~~~ |
