--
Ticket URL: <https://code.djangoproject.com/ticket/25434>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Comment:
As mentioned in the [[https://github.com/django/django/pull/5320|PR]],
this should also be backported to 1.7 and 1.8 with `.. versionadded:: 1.7`
--
Ticket URL: <https://code.djangoproject.com/ticket/25434#comment:1>
* stage: Unreviewed => Accepted
Comment:
It seems a bit odd to me to document attributes that middleware set as
"attributes of `HttpRequest`" but given we have `request.user` documented
like that, I don't see a big reason not to document this other than
`request.user` is far more common (enabled my default in new projects)
than `request.site`. Maybe such attributes could be documented in a
separate section (as a separate ticket) to make it more obvious.
FYI, we aren't making non-critical updates to the 1.7 docs since there's
no workflow for allowing translating those updates, so we'll probably
limit this to 1.8.
--
Ticket URL: <https://code.djangoproject.com/ticket/25434#comment:2>
Comment (by ngnpope):
You've suggested exactly what I was thinking as an alternative - a
separate section detailing the attributes that are added to the request by
middleware. As well as `request.user` and `request.site`, there is also
`request.session` which is set by middleware but currently doesn't mention
the fact. I feel that it is useful to know where these attributes are
meant to come from if they have not been set on the request object.
Would you rather that I just altered this ticket and the pull request
instead of creating a separate ticket? One ticket along the lines of
"separated docs for attributes set by middleware and added missing
entries" seems sufficient.
--
Ticket URL: <https://code.djangoproject.com/ticket/25434#comment:3>
Comment (by timgraham):
Okay with me.
--
Ticket URL: <https://code.djangoproject.com/ticket/25434#comment:4>
* needs_better_patch: 0 => 1
--
Ticket URL: <https://code.djangoproject.com/ticket/25434#comment:5>
* needs_better_patch: 1 => 0
Comment:
[https://github.com/django/django/pull/5465 Updated PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/25434#comment:6>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/25434#comment:7>
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"02ef96c5e58d8d3492b6e38246c8268f1a0de47e" 02ef96c5]:
{{{
#!CommitTicketReference repository=""
revision="02ef96c5e58d8d3492b6e38246c8268f1a0de47e"
Fixed #25434 -- Documented HttpRequest.site and created a section for
middleware attributes.
Thanks Nick Pope for the initial patch.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/25434#comment:8>
Comment (by Tim Graham <timograham@…>):
In [changeset:"84ec3bfc1111525ee0b21afff870840b2eb13771" 84ec3bf]:
{{{
#!CommitTicketReference repository=""
revision="84ec3bfc1111525ee0b21afff870840b2eb13771"
[1.8.x] Fixed #25434 -- Documented HttpRequest.site and created a section
for middleware attributes.
Thanks Nick Pope for the initial patch.
Backport of 02ef96c5e58d8d3492b6e38246c8268f1a0de47e from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/25434#comment:10>
Comment (by Tim Graham <timograham@…>):
In [changeset:"96c0ba380dfbe96d6ebc8368140d026f6113fe2e" 96c0ba3]:
{{{
#!CommitTicketReference repository=""
revision="96c0ba380dfbe96d6ebc8368140d026f6113fe2e"
[1.9.x] Fixed #25434 -- Documented HttpRequest.site and created a section
for middleware attributes.
Thanks Nick Pope for the initial patch.
Backport of 02ef96c5e58d8d3492b6e38246c8268f1a0de47e from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/25434#comment:9>