Opened 17 years ago

Closed 15 years ago

Last modified 13 years ago

#6385 closed (duplicate)

Make runserver output colorful HTTP status codes

Reported by: Rob Hudson <treborhudson@…> Owned by: nobody
Component: django-admin.py runserver Version: dev
Severity: Keywords: color
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

While developing locally and using the built-in server, it is helpful to be able to quickly scan and see 404s, redirects, errors, etc. The attached diff adds 4 HTTP colors for each of the HTTP status codes of 2xx, 3xx, 4xx, and 5xx.

Attachments (3)

colorize.diff (2.1 KB ) - added by Rob Hudson <treborhudson@…> 17 years ago.
Add HTTP colors to runserver output
color_status_codes.png (6.4 KB ) - added by Rob Hudson <treborhudson@…> 17 years ago.
PNG showing output from runserver
0021-Colorize-HTTP-server-log-output.patch (2.7 KB ) - added by Bastian Kleineidam <calvin@…> 17 years ago.
split off coloring in a separate function

Download all attachments as: .zip

Change History (8)

by Rob Hudson <treborhudson@…>, 17 years ago

Attachment: colorize.diff added

Add HTTP colors to runserver output

comment:1 by Rob Hudson <treborhudson@…>, 17 years ago

PS: This is similar to #1491. I'll also attach a screenshot of it in action.

by Rob Hudson <treborhudson@…>, 17 years ago

Attachment: color_status_codes.png added

PNG showing output from runserver

comment:2 by Simon Greenhill <dev@…>, 17 years ago

Triage Stage: UnreviewedDesign decision needed

by Bastian Kleineidam <calvin@…>, 17 years ago

split off coloring in a separate function

comment:3 by Russell Keith-Magee, 15 years ago

milestone: 1.2
Triage Stage: Design decision neededAccepted

The most recent patch is a good start; here are a few comments:

1) I'd rather see the whole line colorized - not just the status code.

2) 2XX is a normal success - I'd argue that shouldn't have any colorization. The 3XX case is worth noting (and worth being easy to see), but it probably doesn't need to be bold. The 4XX and 5XX cases are both bad, and should be bold, and in warning colors (yellow/red))

3) Blue is a really bad choice of color for 3XX - its almost invisible on a black background. Green would be a better choice

4) I'd rather see this display code isolated to the development server. By putting it in basehttp, every single Django server will be colorizing - even if that colorization is a no-op. This is an overhead that the dev server can wear, but we shouldn't force onto every WSGI/mod_python/fcgi.


comment:4 by Russell Keith-Magee, 15 years ago

Resolution: duplicate
Status: newclosed

Marking as a duplicate of #7679.

comment:5 by Jacob, 13 years ago

milestone: 1.2

Milestone 1.2 deleted

Note: See TracTickets for help on using tickets.
Back to Top