Opened 6 years ago

Closed 9 months ago

#12098 closed New feature (fixed)

HttpRequest __repr__ too verbose

Reported by: Cody Soyland <codysoyland@…> Owned by: berkerpeksag
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@…> 6 years ago.
Replaces output of request.repr with the method and URL
requestrepr.2.diff (5.5 KB) - added by Cody Soyland <codysoyland@…> 6 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@…> 6 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 6 years ago by Cody Soyland <codysoyland@…>

Replaces output of request.repr with the method and URL

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

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

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

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

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

This is probably ready for check-in now.

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

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

comment:3 Changed 6 years ago by russellm

  • Triage Stage changed from Unreviewed to Accepted

comment:4 Changed 4 years ago by julien

  • Severity set to Normal
  • Type set to New feature

comment:5 Changed 4 years ago by thejaswi_puthraya

  • Component changed from Uncategorized to HTTP handling
  • Easy pickings unset
  • UI/UX unset

comment:6 Changed 4 years ago by lukeplant

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

comment:7 Changed 9 months ago by berkerpeksag

  • Needs tests unset
  • Owner changed from nobody to berkerpeksag
  • Status changed from new to assigned
  • Version changed from 1.1 to master

comment:8 Changed 9 months ago by claudep

  • Triage Stage changed from Accepted to Ready for checkin

Looks good!

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

  • Resolution set to fixed
  • Status changed from assigned to closed
Note: See TracTickets for help on using tickets.
Back to Top