Skip to content

Commit 84252b1

Browse files
committed
django-admin will print info about the name change
1 parent af198fb commit 84252b1

File tree

1 file changed

+16
-14
lines changed

1 file changed

+16
-14
lines changed

draft/0000-name-main-command-django.rst

+16-14
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,13 @@ Specification
2929

3030
The ``django`` command will be added as the preferred spelling
3131
for the existing ``django-admin`` command.
32+
The ``django-admin`` command will remain indefinitely,
33+
with a message that says
3234

33-
.. code-block:: diff
34-
35-
--- a/pyproject.toml
36-
+++ b/pyproject.toml
37-
@@ -45,2 +45,3 @@
38-
[project.scripts]
39-
+django = "django.core.management:execute_from_command_line"
40-
django-admin = "django.core.management:execute_from_command_line"
35+
> The ``django-admin`` command is being renamed to ``django``.
36+
> You can keep using either name,
37+
> they are equivalent except for the printing of this message.
38+
> For more details on the naming change, see DEP XXXX.
4139

4240
Official documentation will be updated
4341
to reference this new ``django`` command
@@ -52,8 +50,9 @@ Backwards Compatibility
5250
=======================
5351

5452
The existing ``django-admin`` command will remain indefinitely
55-
as an alias of the ``django`` command.
56-
There are no plans to deprecate or remove the ``django-admin`` alias.
53+
as an alias of the ``django`` command,
54+
with messaging about the new name.
55+
There are no plans to remove the ``django-admin`` alias.
5756

5857
Motivation
5958
==========
@@ -125,7 +124,7 @@ so we should be cautious with adding this burden.
125124

126125
Because the existing command will remain,
127126
the benefits of having the command follow common conventions
128-
and build the right mental model for new developers outweighs the cost.
127+
and build the right mental model for new developers outweigh the cost.
129128

130129
More than one way to do it
131130
--------------------------
@@ -136,9 +135,11 @@ and worry what differences there are between them.
136135
This concern is especially relevant because of the volume
137136
of external resources that reference the existing command name.
138137

139-
This drawback is partially mitigated by clear documentation
138+
This drawback is mitigated by clear documentation
140139
that the two commands are equivalent,
141-
and the benefits of following common convention again outweight the cost.
140+
the added messaging in the ``django-admin`` command,
141+
and because the benefits of
142+
following common convention outweigh the cost.
142143

143144
Ambiguity
144145
---------
@@ -161,7 +162,8 @@ Only add an alias
161162
-----------------
162163

163164
This could be a less invasive change by only adding the new command name,
164-
and not modifying the documentation.
165+
and not modifying the documentation
166+
or printing a message in the ``django-admin`` command.
165167
This would avoid the vast majority of the work involved in this change.
166168
However, some common challenges are caused
167169
by the command name being different from the package name,

0 commit comments

Comments
 (0)