[Django] #28469: Add "missing" response type subclasses

8 views
Skip to first unread message

Django

unread,
Aug 6, 2017, 4:15:01 PM8/6/17
to django-...@googlegroups.com
#28469: Add "missing" response type subclasses
-------------------------------------------------+------------------------
Reporter: Adam (Chainz) Johnson | Owner: nobody
Type: New feature | Status: new
Component: HTTP handling | Version: 1.11
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------------------+------------------------
In the past Django has refused to add more HttpResponse subclasses to
support all the codes listed in the HTTP RFC, e.g. in #9943
, HttpResponseNoContent in #3362, etc.

A recent discussion on the django-developers mailing list (
https://groups.google.com/forum/#!msg/django-
developers/gnfX1m5jfm8/lMAucX_oBAAJ ) came to the consensus that adding
them would be a win. It also pointed out existing implementations in
django-extras, documented at https://django-
extras.readthedocs.io/en/latest/ref/http-response.html .

They should be added to Django core.

--
Ticket URL: <https://code.djangoproject.com/ticket/28469>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Aug 9, 2017, 6:19:39 PM8/9/17
to django-...@googlegroups.com
#28469: Add additional response type subclasses
-------------------------------------+-------------------------------------
Reporter: Adam (Chainz) | Owner: nobody
Johnson |

Type: New feature | Status: new
Component: HTTP handling | Version: 1.11
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* stage: Unreviewed => Accepted


Old description:

> In the past Django has refused to add more HttpResponse subclasses to
> support all the codes listed in the HTTP RFC, e.g. in #9943
> , HttpResponseNoContent in #3362, etc.
>
> A recent discussion on the django-developers mailing list (
> https://groups.google.com/forum/#!msg/django-
> developers/gnfX1m5jfm8/lMAucX_oBAAJ ) came to the consensus that adding
> them would be a win. It also pointed out existing implementations in
> django-extras, documented at https://django-
> extras.readthedocs.io/en/latest/ref/http-response.html .
>
> They should be added to Django core.

New description:

In the past Django has refused to add more HttpResponse subclasses to
support all the codes listed in the HTTP RFC, e.g. in #9943,
HttpResponseNoContent in #3362, etc.

[https://groups.google.com/forum/#!msg/django-
developers/gnfX1m5jfm8/lMAucX_oBAAJ A recent discussion] on the django-
developers mailing list came to the consensus that adding them would be a
win. It also pointed out [https://django-
extras.readthedocs.io/en/latest/ref/http-response.html existing
implementations in django-extras].

They should be added to Django core.

--

Comment:

As I mentioned on the mailing list, I don't think we should add subclasses
if they don't provide any functionality besides a different status code.
For that, we could document this pattern:
{{{
from http import HTTPStatus
HttpResponse(status=HTTPStatus.NO_CONTENT)
}}}
If a response subclass provides some other additional functionality, I'm
open to adding it.

--
Ticket URL: <https://code.djangoproject.com/ticket/28469#comment:1>

Django

unread,
Nov 22, 2019, 4:00:52 PM11/22/19
to django-...@googlegroups.com
#28469: Add additional response type subclasses
-------------------------------------+-------------------------------------
Reporter: Adam (Chainz) | Owner: nobody
Johnson |
Type: New feature | Status: new
Component: HTTP handling | Version: 1.11
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Baptiste Mispelon):

* has_patch: 0 => 1


Comment:

I took a first stab at a documentation patch for this:
https://github.com/django/django/pull/12126

--
Ticket URL: <https://code.djangoproject.com/ticket/28469#comment:2>

Django

unread,
Nov 25, 2019, 2:36:58 AM11/25/19
to django-...@googlegroups.com
#28469: Add additional response type subclasses
-------------------------------------+-------------------------------------
Reporter: Adam (Chainz) | Owner: nobody
Johnson |
Type: New feature | Status: closed

Component: HTTP handling | Version: 1.11
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak <felisiak.mariusz@…>):

* status: new => closed
* resolution: => fixed


Comment:

In [changeset:"9f1ec9efc35bbb375c9cebb3e0d8c1b7be838338" 9f1ec9e]:
{{{
#!CommitTicketReference repository=""
revision="9f1ec9efc35bbb375c9cebb3e0d8c1b7be838338"
Fixed #28469 -- Doc'd how to create a custom HttpResponse subclass.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28469#comment:3>

Django

unread,
Nov 25, 2019, 2:36:59 AM11/25/19
to django-...@googlegroups.com
#28469: Add additional response type subclasses
-------------------------------------+-------------------------------------
Reporter: Adam (Chainz) | Owner: nobody
Johnson |
Type: New feature | Status: closed
Component: HTTP handling | Version: 1.11
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"76e0846c90e872a04638a835b7c33b41874441d2" 76e0846c]:
{{{
#!CommitTicketReference repository=""
revision="76e0846c90e872a04638a835b7c33b41874441d2"
[3.0.x] Fixed #28469 -- Doc'd how to create a custom HttpResponse
subclass.

Backport of 9f1ec9efc35bbb375c9cebb3e0d8c1b7be838338 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28469#comment:4>

Django

unread,
Nov 25, 2019, 2:37:00 AM11/25/19
to django-...@googlegroups.com
#28469: Add additional response type subclasses
-------------------------------------+-------------------------------------
Reporter: Adam (Chainz) | Owner: nobody
Johnson |
Type: New feature | Status: closed
Component: HTTP handling | Version: 1.11
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Mariusz Felisiak <felisiak.mariusz@…>):

In [changeset:"ad56858e83c39f50612f635500a1a5df37b245d3" ad56858e]:
{{{
#!CommitTicketReference repository=""
revision="ad56858e83c39f50612f635500a1a5df37b245d3"
[2.2.x] Fixed #28469 -- Doc'd how to create a custom HttpResponse
subclass.

Backport of 9f1ec9efc35bbb375c9cebb3e0d8c1b7be838338 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28469#comment:5>

Reply all
Reply to author
Forward
0 new messages