问题
When running the django test server on a local project, can you make 400/500 errors stand out in a different color in output text?
回答1:
The colors can be controlled using the DJANGO_COLORS
environment variable. See the docs on syntax coloring: https://docs.djangoproject.com/en/1.3/ref/django-admin/#syntax-coloring
This requires Django >= 1.2 and a platform which supports colors (disabled on Windows).
回答2:
LINK UPDATE: docs for version 1.3 are no longer available from docs.django.com. The current version of the doc on syntax coloring is here:
https://docs.djangoproject.com/en/1.9/ref/django-admin/#syntax-coloring
来源:https://stackoverflow.com/questions/9027654/change-colors-of-output-log-text-from-django-development-server