In May 2020 I wrote to django-developers proposing a rename of some core attributes on
As a reminder the proposal is this:
request.POSTare misleadingly named:
GETcontains the URL parameters and is therefore available whatever the request method. This often confuses beginners and “returners” alike.
POSTcontains form data for POST requests, but not other kinds of data from POST requests. It can confuse users who are posting JSON or other formats.
Additionally both names can lead users to think e.g.
if this is a GET request, which is not true.
I believe the CAPITALIZED naming style was inherited from PHP’s global variables $_GET, $_POST, $_FILES etc. ( PHP docs ). It stands out as unpythonic, since these are instance variables and not module-level constants (as per PEP8 ).
I therefore propose these renames:
request.query_params(to match Django Rest Framework - discussed later in mail)
I later opened Ticket #32259, with a PR. One fellow accepted the ticket, and the other later closed it as wontfix for being too disruptive.
I can see the problem with the churn, but I still believe the change is worth it. When I’ve since mentioned it to other Django developers they have been in favour.
I think we can control the churn. The old names will be left in place with no deprecation warnings, the release notes will have a section covering the change, and you can bet I’ll write a blog post. Also my recent project django-upgrade will have a “fixer” to automatically migrate projects to the new names.
So as per the DEP 10 voting process I am calling on the technical board to vote on the proposal:
Shall the Django project accept and begin implementation of Ticket #32259?
The voting period of 1 week means this will close on the 2nd November.
For the record my vote is “accept”.