I am looking for an answer concerning the color used in the output during a session of python2 manage.py runserver
I'm sure that understanding why some output is yellow, blue, or pink will help me to perform better debugging.
This is the default palette:
'ERROR': { 'fg': 'red', 'opts': ('bold',) },
'NOTICE': { 'fg': 'red' },
'SQL_FIELD': { 'fg': 'green', 'opts': ('bold',) },
'SQL_COLTYPE': { 'fg': 'green' },
'SQL_KEYWORD': { 'fg': 'yellow' },
'SQL_TABLE': { 'opts': ('bold',) },
'HTTP_INFO': { 'opts': ('bold',) },
'HTTP_SUCCESS': { },
'HTTP_REDIRECT': { 'fg': 'green' },
'HTTP_NOT_MODIFIED': { 'fg': 'cyan' },
'HTTP_BAD_REQUEST': { 'fg': 'red', 'opts': ('bold',) },
'HTTP_NOT_FOUND': { 'fg': 'yellow' },
'HTTP_SERVER_ERROR': { 'fg': 'magenta', 'opts': ('bold',) },
Haven't done it by myself, but here are some links which will help:
Basically, colors are set via DJANGO_COLORS
environment variable:
export DJANGO_COLORS="light"
To add a bit more to Pavel's answer, here is the location of the file that contains the default color settings on a Mac (OSX 10.11 El Capitan). Note: this is for Django 1.9.
The color palette is located in a file called: termcolors.py, which is located in:
/django/utils/
I installed Django in a virtual environment ("venv1"), so for me, the termcolors.py file is located here:
~/.virtualenvs/venv1/lib/python3.4/site-packages/django/utils/termcolors.py
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With