#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 <https://code.djangoproject.com/> The Web framework for perfectionists with deadlines. -- You received this message because you are subscribed to the Google Groups "Django updates" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/068.2f7d7f9c7f717ddfcce58cadeb2677e6%40djangoproject.com. For more options, visit https://groups.google.com/d/optout.