Opened 9 years ago

Closed 9 years ago

#25822 closed New feature (wontfix)

Create require_HEAD, require_OPTIONS, require_PUT, etc. in django.views.decorators.http

Reported by: James Owned by: James
Component: Utilities Version: 1.8
Severity: Normal Keywords:
Cc: CrazyPython@… Triage Stage: Unreviewed
Has patch: yes Needs documentation: yes
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description (last modified by James)

In django.views.decorators.http, require_GET and require_POST shortcuts exist, however none exist for the other HTTP methods. A list can be found here: http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html

My Pull Request on GitHub here: https://github.com/django/django/pull/5731

We need documentation, however.

Isn't Open Source just awesome? You want a feature, you add the feature! Then you open fork it on github, open a PR, and BOOM! There you go, all the project creators have to do is click "Merge"!

Change History (7)

comment:1 by James, 9 years ago

Description: modified (diff)

comment:2 by James, 9 years ago

Cc: CrazyPython@… added
Description: modified (diff)

comment:3 by James, 9 years ago

Description: modified (diff)
Needs documentation: set
Owner: changed from nobody to James
Status: newassigned

comment:4 by James, 9 years ago

Has patch: set

comment:5 by Tim Graham, 9 years ago

From Alex in #9943, "If you'd like feel free to open a seperate ticket for the decorators, although it is my inclination that that will, and should be, won't fixed as well."

I don't feel too strongly either way, however, I found only a few projects implementing their own versions of require_PUT and require_DELETE and nothing for HEAD or OPTIONS.

comment:6 by Aymeric Augustin, 9 years ago

Since browsers don't do anything other than GET and POST and since APIs are usually built on top of frameworks (DRF, or even just Django class based views) which have better APIs for enforcing such restrictions, I don't believe this is useful. The "consistency" argument isn't enough for convincing me.

comment:7 by Tim Graham, 9 years ago

Resolution: wontfix
Status: assignedclosed

CrazyPython, feel free to raise the issue on the DevelopersMailingList if you disagree with the rationale presented here. Thanks!

Note: See TracTickets for help on using tickets.
Back to Top