Request repr():
<HttpRequest
path:/somepath/,
'''USER:None,'''
GET:{'get-key': 'get-value'},
POST:{'post-key': 'post-value'},
COOKIES:{'post-key': 'post-value'},
META:{'post-key': 'post-value'}>
--
Ticket URL: <https://code.djangoproject.com/ticket/25037>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* Attachment "25037.diff" added.
* Attachment "25037.diff" added.
* needs_better_patch: => 0
* has_patch: 0 => 1
* needs_tests: => 0
* needs_docs: => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/25037#comment:1>
* needs_better_patch: 0 => 1
* component: Uncategorized => HTTP handling
* needs_tests: 0 => 1
* stage: Unreviewed => Accepted
Comment:
I think this is a nice addition. Would it be possible to transform the
patch in a pull request?
We'll also need more tests (with anonymous user, authenticated user,
custom user, etc.).
--
Ticket URL: <https://code.djangoproject.com/ticket/25037#comment:2>
Comment (by timgraham):
Although it's a common pattern to set `request.user`, I had some
reservations about coupling `HttpRequest` and `contrib.auth` when I first
read this.
Sentry seems to have some way to associate exceptions with users. Maybe it
would be worth looking at how they accomplish that?
--
Ticket URL: <https://code.djangoproject.com/ticket/25037#comment:3>
Comment (by djbaldey):
Replying to [comment:3 timgraham]:
> Although it's a common pattern to set `request.user`, I had some
reservations about coupling `HttpRequest` and `contrib.auth` when I first
read this.
>
> Sentry seems to have some way to associate exceptions with users. Maybe
it would be worth looking at how they accomplish that?
This decision does not depend on contrib.auth and request.user. But when
there they - it is of great help to solve the problems of administrators.
--
Ticket URL: <https://code.djangoproject.com/ticket/25037#comment:4>
Comment (by vzima):
Note, that `build_request_repr` was removed in #25099.
--
Ticket URL: <https://code.djangoproject.com/ticket/25037#comment:5>
* component: HTTP handling => Error reporting
* easy: 0 => 1
Comment:
It seems the new alternative would be to add it to
`views.debug.TECHNICAL_500_TEMPLATE` and `TECHNICAL_500_TEXT_TEMPLATE`
under "Request information".
--
Ticket URL: <https://code.djangoproject.com/ticket/25037#comment:6>
* status: new => assigned
* owner: nobody => JulianGindi
--
Ticket URL: <https://code.djangoproject.com/ticket/25037#comment:7>
Comment (by JulianGindi):
Based on the latest comment, I'll move ahead with the mentioned
implementation as opposed to continuing the work from the first patch.
Does that sound right?
--
Ticket URL: <https://code.djangoproject.com/ticket/25037#comment:8>
Comment (by timgraham):
Yes, the initial patch will no longer apply.
--
Ticket URL: <https://code.djangoproject.com/ticket/25037#comment:9>
Comment (by jonaldomo):
Where should the associated test with this go?
--
Ticket URL: <https://code.djangoproject.com/ticket/25037#comment:10>
Comment (by timgraham):
There are tests for the debug view in
`tests/view_tests/tests/test_debug.py`.
--
Ticket URL: <https://code.djangoproject.com/ticket/25037#comment:11>
* owner: JulianGindi => jonaldomo
--
Ticket URL: <https://code.djangoproject.com/ticket/25037#comment:12>
Comment (by jonaldomo):
How does this look? https://github.com/django/django/pull/5381
--
Ticket URL: <https://code.djangoproject.com/ticket/25037#comment:13>
* needs_tests: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/25037#comment:14>
* needs_better_patch: 1 => 0
--
Ticket URL: <https://code.djangoproject.com/ticket/25037#comment:15>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"2b6344e9447b5a62cb779b92b061b783bdef5f1c" 2b6344e]:
{{{
#!CommitTicketReference repository=""
revision="2b6344e9447b5a62cb779b92b061b783bdef5f1c"
Fixed #25037 -- Added request.user to the debug view.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/25037#comment:16>