Opened 4 years ago

Closed 4 years ago

#29666 closed Bug (needsinfo)

TypeError: create_superuser() takes exactly 4 arguments (3 given)

Reported by: bw2 Owned by: Jeff
Component: contrib.auth Version: 2.1
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by bw2)


 echo 'bla' | python -u createsuperuser --username test --email test


Superuser creation skipped due to not running in a TTY. You can run ` createsuperuser` in your project to create 

as expected, but then also raises this error:

Traceback (most recent call last):
  File "", line 10, in <module>
  File "/Users/weisburd/Library/Python/2.7/lib/python/site-packages/django/core/management/", line 363, in execute_from_command_line
  File "/Users/weisburd/Library/Python/2.7/lib/python/site-packages/django/core/management/", line 355, in execute
  File "/Users/weisburd/Library/Python/2.7/lib/python/site-packages/django/core/management/", line 283, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/Users/weisburd/Library/Python/2.7/lib/python/site-packages/django/contrib/auth/management/commands/", line 63, in execute
    return super(Command, self).execute(*args, **options)
  File "/Users/weisburd/Library/Python/2.7/lib/python/site-packages/django/core/management/", line 330, in execute
    output = self.handle(*args, **options)
  File "/Users/weisburd/Library/Python/2.7/lib/python/site-packages/django/contrib/auth/management/commands/", line 183, in handle
TypeError: create_superuser() takes exactly 4 arguments (3 given)

Change History (6)

comment:1 Changed 4 years ago by bw2

Description: modified (diff)

comment:2 Changed 4 years ago by Jeff

Owner: changed from nobody to Jeff
Status: newassigned

I'll look at this

comment:3 Changed 4 years ago by Jeff

I got the same TTY exception running this in my terminal, but did not receive the second error. Could you provide some more information on your system, where you ran the command, and copy paste the I/O for me?

comment:4 Changed 4 years ago by Ramiro Morales

It's strange the issue was opened against version 2.1 but the traceback shows things running under Python 2.7.

comment:5 Changed 4 years ago by Jeff

very true. I ran with python3 on master and saw no sign of the TypeError. Starting to sound like this may not be a real issue. bw2, can you confirm you were using python2.7 and on version 2.1?

comment:6 Changed 4 years ago by Tim Graham

Component: Uncategorizedcontrib.auth
Resolution: needsinfo
Status: assignedclosed
Type: UncategorizedBug

I couldn't reproduce on Django 1.11. Maybe a custom user model and an incorrectly written user manager is the cause?

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