[Django] #36322: "Enhance manage.py CLI: Suggest alternatives for unknown commands (typo correction)"

10 views
Skip to first unread message

Django

unread,
Apr 12, 2025, 7:31:21 AMApr 12
to django-...@googlegroups.com
#36322: "Enhance manage.py CLI: Suggest alternatives for unknown commands (typo
correction)"
-------------------------------------+-------------------------------------
Reporter: Rishav | Type: New
| feature
Status: new | Component: Core
| (Management commands)
Version: 5.2 | Severity: Normal
Keywords: CLI management | Triage Stage:
commands typo correction command | Unreviewed
suggestions difflib Dev UX Django |
improvement error handling |
command-line interface helpful |
error messages Django core |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
When using manage.py, if a user enters an incorrect or misspelled command,
Django currently does not provide suggestions for the correct command.
This can lead to frustration, especially for developers who may make
typographical errors or are unsure of the exact command name.

Proposed Solution: Enhance the manage.py command-line interface to
automatically suggest possible alternatives for unknown commands. The
suggestion should be based on a comparison between the user’s input and
the available commands using Python’s built-in difflib.get_close_matches()
function. This will help users by displaying a helpful message indicating
potential command suggestions.
--
Ticket URL: <https://code.djangoproject.com/ticket/36322>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Apr 12, 2025, 7:33:59 AMApr 12
to django-...@googlegroups.com
#36322: "Enhance manage.py CLI: Suggest alternatives for unknown commands (typo
correction)"
-------------------------------------+-------------------------------------
Reporter: Rishav | Owner: (none)
Type: New feature | Status: new
Component: Core (Management | Version: 5.2
commands) |
Severity: Normal | Resolution:
Keywords: CLI management | Triage Stage:
commands typo correction command | Unreviewed
suggestions difflib Dev UX Django |
improvement error handling |
command-line interface helpful |
error messages Django core |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Comment (by Rishav):

Typo in Command:
Input: python manage.py runsever
output: Unknown command: 'runsever'. Did you mean 'runserver'?

Input: python manage.py makemgrations
output:Unknown command: 'makemgrations'. Did you mean 'makemigrations' or
'migrate'?
--
Ticket URL: <https://code.djangoproject.com/ticket/36322#comment:1>

Django

unread,
Apr 12, 2025, 9:08:23 AMApr 12
to django-...@googlegroups.com
#36322: "Enhance manage.py CLI: Suggest alternatives for unknown commands (typo
correction)"
-------------------------------------+-------------------------------------
Reporter: Rishav | Owner: (none)
Type: New feature | Status: new
Component: Core (Management | Version: 5.2
commands) |
Severity: Normal | Resolution:
Keywords: CLI management | Triage Stage:
commands typo correction command | Unreviewed
suggestions difflib Dev UX Django |
improvement error handling |
command-line interface helpful |
error messages Django core |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Clifford Gama):

* ui_ux: 1 => 0

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

Django

unread,
Apr 12, 2025, 2:39:17 PMApr 12
to django-...@googlegroups.com
#36322: "Enhance manage.py CLI: Suggest alternatives for unknown commands (typo
correction)"
-------------------------------------+-------------------------------------
Reporter: Rishav | Owner: (none)
Type: New feature | Status: new
Component: Core (Management | Version: 5.2
commands) |
Severity: Normal | Resolution:
Keywords: CLI management | Triage Stage:
commands typo correction command | Unreviewed
suggestions difflib Dev UX Django |
improvement error handling |
command-line interface helpful |
error messages Django core |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Rishav):

* ui_ux: 0 => 1

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

Django

unread,
Apr 12, 2025, 2:45:23 PMApr 12
to django-...@googlegroups.com
#36322: "Enhance manage.py CLI: Suggest alternatives for unknown commands (typo
correction)"
-------------------------------------+-------------------------------------
Reporter: Rishav | Owner: (none)
Type: New feature | Status: new
Component: Core (Management | Version: 5.2
commands) |
Severity: Normal | Resolution:
Keywords: CLI management | Triage Stage:
commands typo correction command | Unreviewed
suggestions difflib Dev UX Django |
improvement error handling |
command-line interface helpful |
error messages Django core |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Comment (by Rishav):

Re-enabling the UI/UX flag since this feature directly impacts the
developer experience when interacting with the CLI. While it's not a
graphical interface, improving how Django handles mistyped commands (by
suggesting close matches) significantly enhances usability and reduces
friction for users, especially beginners. Happy to clarify further if
needed!Replying to [comment:2 Clifford Gama]:
--
Ticket URL: <https://code.djangoproject.com/ticket/36322#comment:4>

Django

unread,
Apr 13, 2025, 8:59:07 PMApr 13
to django-...@googlegroups.com
#36322: "Enhance manage.py CLI: Suggest alternatives for unknown commands (typo
correction)"
-------------------------------------+-------------------------------------
Reporter: Rishav | Owner: (none)
Type: New feature | Status: new
Component: Core (Management | Version: 5.2
commands) |
Severity: Normal | Resolution:
Keywords: CLI management | Triage Stage:
commands typo correction command | Unreviewed
suggestions difflib Dev UX Django |
improvement error handling |
command-line interface helpful |
error messages Django core |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Comment (by ontowhee):

Would this ticket be considered a duplicate of #36321?
--
Ticket URL: <https://code.djangoproject.com/ticket/36322#comment:5>

Django

unread,
Apr 14, 2025, 4:10:37 AMApr 14
to django-...@googlegroups.com
#36322: "Enhance manage.py CLI: Suggest alternatives for unknown commands (typo
correction)"
-------------------------------------+-------------------------------------
Reporter: Rishav | Owner: (none)
Type: New feature | Status: closed
Component: Core (Management | Version: 5.2
commands) |
Severity: Normal | Resolution: duplicate
Keywords: CLI management | Triage Stage:
commands typo correction command | Unreviewed
suggestions difflib Dev UX Django |
improvement error handling |
command-line interface helpful |
error messages Django core |
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 1
-------------------------------------+-------------------------------------
Changes (by Sarah Boyce):

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

Comment:

Replying to [comment:5 ontowhee]:
> Would this ticket be considered a duplicate of #36321?

Yes I agree
--
Ticket URL: <https://code.djangoproject.com/ticket/36322#comment:6>
Reply all
Reply to author
Forward
0 new messages