Let `manage.py` learn --colour/--color option to control if colouring output is wanted by user
|Reported by:||rabio||Owned by:||nobody|
|Component:||Core (Management commands)||Version:||master|
|Cc:||Triage Stage:||Design decision needed|
|Has patch:||no||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
It will be nice if manage.py could understand --colour/--color options like grep do for example (i.e always / never / guess).
- It may be still reasonable to force manage.py to output colour escape sequences even when output is not send to a tty (now escape sequences for colour are supresed in this case). For example, this may happen when its output is redirected to less -R or tail.
- Even when switching colours off may be achieved now by setting DJANGO_COLORS=nocolor environment variable (or to any palette name not known to django.utils.termcolors), it is not obvious way to achieve this and it is not always as easy to set / change environment variable as it is to run command with additional option.
- See also #17221 for additional rationale as this enhancement may provide temporary workaround for it.