[1.7.x] Fixed #23107 -- Made runserver output respect --no-color.

Backport of 67d7da5fb9 from master
[1.7.x] Fixed flake8 errors.

Backport of 34c60c42b6 from master