Opened 7 years ago

Closed 23 months ago

#12098 closed New feature (fixed)

HttpRequest __repr__ too verbose

Reported by: Cody Soyland <codysoyland@…> Owned by: Berker Peksag
Component: HTTP handling Version: master
Severity: Normal Keywords:
Cc: codysoyland@… Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

When working from a shell, printing request always fills my terminal with unneeded information. I would like to type locals() within a view without garbage all over my screen and type request.META, request.POST, etc if I would like to see more details. My patch replaces GET, POST, COOKIES, and META with the method and URL.

Attachments (3)

requestrepr.diff (3.3 KB) - added by Cody Soyland <codysoyland@…> 7 years ago.
Replaces output of request.repr with the method and URL
requestrepr.2.diff (5.5 KB) - added by Cody Soyland <codysoyland@…> 7 years ago.
This patch does handles parse errors in get_full_path and adds request metadata to error emails.
requestrepr.3.diff (5.5 KB) - added by Cody Soyland <codysoyland@…> 7 years ago.
The only difference from the last patch is that this one uses an unqualified exception catcher.

Download all attachments as: .zip

Change History (12)

Changed 7 years ago by Cody Soyland <codysoyland@…>

Attachment: requestrepr.diff added

Replaces output of request.repr with the method and URL

comment:1 Changed 7 years ago by Cody Soyland <codysoyland@…>

Cc: codysoyland@… added
Needs documentation: unset
Needs tests: set
Patch needs improvement: unset

Changed 7 years ago by Cody Soyland <codysoyland@…>

Attachment: requestrepr.2.diff added

This patch does handles parse errors in get_full_path and adds request metadata to error emails.

comment:2 Changed 7 years ago by Cody Soyland <codysoyland@…>

This is probably ready for check-in now.

Changed 7 years ago by Cody Soyland <codysoyland@…>

Attachment: requestrepr.3.diff added

The only difference from the last patch is that this one uses an unqualified exception catcher.

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

Triage Stage: UnreviewedAccepted

comment:4 Changed 5 years ago by Julien Phalip

Severity: Normal
Type: New feature

comment:5 Changed 5 years ago by Thejaswi Puthraya

Component: UncategorizedHTTP handling
Easy pickings: unset
UI/UX: unset

comment:6 Changed 5 years ago by Luke Plant

See also #16178, which logically should go in first.

comment:7 Changed 23 months ago by Berker Peksag

Needs tests: unset
Owner: changed from nobody to Berker Peksag
Status: newassigned
Version: 1.1master

comment:8 Changed 23 months ago by Claude Paroz

Triage Stage: AcceptedReady for checkin

Looks good!

comment:9 Changed 23 months ago by Tim Graham <timograham@…>

Resolution: fixed
Status: assignedclosed
Note: See TracTickets for help on using tickets.
Back to Top