How to colorize Django test results in OSX terminal?
<p>I'd like to colorize the Django test outputs  with the nice visual queues of "green=pass, red=failure" font colors in the terminal, similar to what I get with rails/rake (e.g. ....F..FF.... where F is red for failure and the dots are green for passing unit tests).
Anyone know how to do this easily?  Is there a bash_profile or python import or setting?  </p>

<p>Django has it <a href="https://docs.djangoproject.com/en/dev/ref/django-admin/#syntax-coloring" rel="nofollow">built-in</a>.</p>

<p>The colors used for syntax highlighting can be customized. Django ships with three color palettes:</p>

<ul>
<li>dark, suited to terminals that show white text on a black background. This is the default palette.</li>
<li>light, suited to terminals that show black text on a white background.</li>
<li>nocolor, which disables syntax highlighting.</li>
</ul>

<p>You select a palette by setting a DJANGO_COLORS environment variable to specify the palette you want to use. For example, to specify the light palette under a Unix or OS/X BASH shell, you would run the following at a command prompt:</p>

<pre><code>export DJANGO_COLORS="light"
</code></pre>

<p>There's also <a href="https://github.com/tiliv/django-colors-formatter" rel="nofollow">django-colors-formatter</a> package if you wish more customization:</p>

<pre><code>LOGGING = {
    'formatters': {
        'colored': {
            '()': 'djangocolors_formatter.DjangoColorsFormatter',
            'format': '%(levelname)s %(module)s %(message)s',
        },
    },
    'handlers': {
        'level': 'DEBUG',
        'class': 'logging.StreamHandler',
        'formatter': 'colored',
    },
    'loggers': 
        'myproject': {
            'handlers': ['console'],
            'level': 'DEBUG',
        },
    },    
}
</code></pre>

python django osx terminal