Opened 9 years ago

Closed 7 years ago

Last modified 5 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: master
Severity: Keywords: color
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

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

Download all attachments as: .zip

Change History (8)

Changed 9 years ago by Rob Hudson <treborhudson@…>

Attachment: colorize.diff added

Add HTTP colors to runserver output

comment:1 Changed 9 years ago by Rob Hudson <treborhudson@…>

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

Changed 9 years ago by Rob Hudson <treborhudson@…>

Attachment: color_status_codes.png added

PNG showing output from runserver

comment:2 Changed 9 years ago by Simon Greenhill <dev@…>

Triage Stage: UnreviewedDesign decision needed

Changed 9 years ago by Bastian Kleineidam <calvin@…>

split off coloring in a separate function

comment:3 Changed 7 years ago by Russell Keith-Magee

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 Changed 7 years ago by Russell Keith-Magee

Resolution: duplicate
Status: newclosed

Marking as a duplicate of #7679.

comment:5 Changed 5 years ago by Jacob

milestone: 1.2

Milestone 1.2 deleted

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