Code

Opened 3 years ago

Closed 3 years ago

#16163 closed Cleanup/optimization (invalid)

createsuperuser management command doesn't accept a password

Reported by: anonymous Owned by: nobody
Component: contrib.auth Version: 1.3
Severity: Normal Keywords:
Cc: bradley.ayers@… Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX:

Description

Line 57/58 leads me to believe I should at some point be able to pass a password to the createsuperuser command but there doesn't appear to be any mechanism to accept or test for it. It would be handy to be able to.

https://code.djangoproject.com/browser/django/trunk/django/contrib/auth/management/commands/createsuperuser.py

Attachments (0)

Change History (2)

comment:1 Changed 3 years ago by Bradley Ayers <bradley.ayers@…>

  • Cc bradley.ayers@… added
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 3 years ago by aaugustin

  • Resolution set to invalid
  • Status changed from new to closed

I think the --password option is not made available by design.

It is a bad practice to allow passing passwords on the command line, because the password will end up in clear text in your ~/.${SHELL}_history.

Line 58 only ensures that password is initialized before line 117. It is useful when interactive is False.

Take a look at r15631. The comment was written to explain why the default value is None and not ''. Granted, it's not very clear.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.