#19725 closed Bug (fixed)
`createsuperuser` command fails with custom User model
Reported by: | michisu | Owned by: | nobody |
---|---|---|---|
Component: | contrib.auth | Version: | 1.5-beta-1 |
Severity: | Release blocker | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
If using a custom User model with non-ascii field label, then createsuperuser
command fails.
class MyUser(AbstractBaseUser): email = models.EmailField( u'メールアドレス', max_length=255, unique=True, db_index=True) # ...
$ python manage.py createsuperuser UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-6: ordinal not in range(128)
Change History (6)
comment:1 by , 12 years ago
comment:2 by , 12 years ago
I ran the command with the --traceback
option:
$ python manage.py createsuperuser --traceback Traceback (most recent call last): File "/Users/michisu/VirtualEnvs/ppf/lib/python2.7/site-packages/django/core/management/base.py", line 222, in run_from_argv self.execute(*args, **options.__dict__) File "/Users/michisu/VirtualEnvs/ppf/lib/python2.7/site-packages/django/core/management/base.py", line 255, in execute output = self.handle(*args, **options) File "/Users/michisu/VirtualEnvs/ppf/lib/python2.7/site-packages/django/contrib/auth/management/commands/createsuperuser.py", line 87, in handle raw_value = input(input_msg + ': ') UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-6: ordinal not in range(128)
comment:3 by , 12 years ago
Easy pickings: | set |
---|---|
Severity: | Normal → Release blocker |
Triage Stage: | Unreviewed → Accepted |
comment:4 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
Please run the command with the
--traceback
option so as we can see where's the issue.