Opened 4 weeks ago

Last modified 2 weeks ago

#36972 assigned New feature

Provide help text in password prompts for createsuperuser and changepassword commands

Reported by: Ketan Sahu Owned by: Ketan Sahu
Component: contrib.auth Version: dev
Severity: Normal Keywords:
Cc: Ketan Sahu, Thibaud Colas Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description (last modified by Jacob Walls)

When running python manage.py createsuperuser, the password prompt currently shows:

Password:

Nothing is printed while typing (for security), but many beginners might think the terminal has frozen or the command isn’t working, since there’s no hint that the input is hidden.

Suggestion:
Update the password prompt in the createsuperuser management command to something clearer, like:

Password (input hidden):

or

Password:  [input hidden]

Benefit:

  • Makes clear that password input is working as intended, which is especially helpful for new users or beginners.
  • Prevents confusion that the terminal/command has frozen.
  • Brings Django’s CLI user experience in line with user-friendly conventions.

Contributor note:
I am ready to work on this improvement and would be happy to submit a pull request if this feature is approved or assigned to me.

Thank you for considering this suggestion!

Change History (7)

comment:1 by Jacob Walls, 4 weeks ago

Cc: Thibaud Colas added
Description: modified (diff)
Owner: set to Ketan Sahu
Status: newassigned
Summary: Improve password prompt wording in createsuperuser management commandProvide keyboard feedback in createsuperuser and changepassword commands
Triage Stage: UnreviewedAccepted
Type: Cleanup/optimizationNew feature

Accepting based on positive reception on the forum.

I'd like to reframe this to simply provide keyboard feedback via the echo_char="*" argument on Python 3.14+. I'll cross-post on the forum.

We should address changepassword at the same time (that is, both commands calling getpass()) as mentioned on forum.

Thanks for offering a PR.

Last edited 4 weeks ago by Jacob Walls (previous) (diff)

comment:3 by Ketan Sahu, 4 weeks ago

Has patch: set

comment:4 by Jacob Walls, 4 weeks ago

Needs documentation: set
Needs tests: set
Patch needs improvement: set

comment:5 by Ketan Sahu, 3 weeks ago

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset

comment:6 by Jacob Walls, 3 weeks ago

Triage Stage: AcceptedReady for checkin
Version: 6.0dev

comment:7 by Jacob Walls, 2 weeks ago

Patch needs improvement: set
Summary: Provide keyboard feedback in createsuperuser and changepassword commandsProvide help text in password prompts for createsuperuser and changepassword commands
Triage Stage: Ready for checkinAccepted

As Natalia helpfully pointed out on the forum, echo_char will break CTRL+U, so we're going to need to fall back to the next least objectionable option discussed on the forum, which was to just provide some help text.

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