diff --git a/django/core/servers/basehttp.py b/django/core/servers/basehttp.py index d24eb5c2a3..dae4297379 100644 --- a/django/core/servers/basehttp.py +++ b/django/core/servers/basehttp.py @@ -619,6 +619,8 @@ class WSGIRequestHandler(BaseHTTPRequestHandler): msg = self.style.HTTP_SUCCESS(msg) elif args[1][0] == '1': msg = self.style.HTTP_INFO(msg) + elif args[1] == '304': + msg = self.style.HTTP_NOT_MODIFIED(msg) elif args[1][0] == '3': msg = self.style.HTTP_REDIRECT(msg) elif args[1] == '404': diff --git a/django/utils/termcolors.py b/django/utils/termcolors.py index 4bcf634061..ccafb42524 100644 --- a/django/utils/termcolors.py +++ b/django/utils/termcolors.py @@ -81,6 +81,7 @@ PALETTES = { 'HTTP_INFO': {}, 'HTTP_SUCCESS': {}, 'HTTP_REDIRECT': {}, + 'HTTP_NOT_MODIFIED': {}, 'HTTP_BAD_REQUEST': {}, 'HTTP_NOT_FOUND': {}, 'HTTP_SERVER_ERROR': {}, @@ -95,6 +96,7 @@ PALETTES = { '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',) }, @@ -109,6 +111,7 @@ PALETTES = { 'HTTP_INFO': { 'opts': ('bold',) }, 'HTTP_SUCCESS': { }, 'HTTP_REDIRECT': { 'fg': 'green', 'opts': ('bold',) }, + 'HTTP_NOT_MODIFIED': { 'fg': 'green' }, 'HTTP_BAD_REQUEST': { 'fg': 'red', 'opts': ('bold',) }, 'HTTP_NOT_FOUND': { 'fg': 'red' }, 'HTTP_SERVER_ERROR': { 'fg': 'magenta', 'opts': ('bold',) }, diff --git a/docs/ref/django-admin.txt b/docs/ref/django-admin.txt index af47759745..8ed489deb4 100644 --- a/docs/ref/django-admin.txt +++ b/docs/ref/django-admin.txt @@ -1028,7 +1028,8 @@ number of roles in which color is used: * ``sql_table`` - The name of a model in SQL. * ``http_info`` - A 1XX HTTP Informational server response. * ``http_success`` - A 2XX HTTP Success server response. - * ``http_redirect`` - A 3XX HTTP Redirect server response. + * ``http_not_modified`` - A 304 HTTP Not Modified server response. + * ``http_redirect`` - A 3XX HTTP Redirect server response other than 304. * ``http_not_found`` - A 404 HTTP Not Found server response. * ``http_bad_request`` - A 4XX HTTP Bad Request server response other than 404. * ``http_server_error`` - A 5XX HTTP Server Error response.