我试图在Mac(10.13.3)上的Python(3.6.4)上创建Django(1.11)中的超级用户。
输入用户名后,我按enter
。 enter
不会将我带到下一个输入。
$ python manage.py createsuperuser
Username (leave blank to use 'neon'): admin^M^M^M^M^M^M^M^M^C^CKeyboardInterrupt
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "manage.py", line 22, in <module>
execute_from_command_line(sys.argv)
File "/Users/neon/workspace/jp/lib/python3.6/site-packages/Django-1.11-py3.6.egg/django/core/management/__init__.py", line 363, in execute_from_command_line
utility.execute()
File "/Users/neon/workspace/jp/lib/python3.6/site-packages/Django-1.11-py3.6.egg/django/core/management/__init__.py", line 355, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Users/neon/workspace/jp/lib/python3.6/site-packages/Django-1.11-py3.6.egg/django/core/management/base.py", line 283, in run_from_argv
self.execute(*args, **cmd_options)
File "/Users/neon/workspace/jp/lib/python3.6/site-packages/Django-1.11-py3.6.egg/django/contrib/auth/management/commands/createsuperuser.py", line 63, in execute
return super(Command, self).execute(*args, **options)
File "/Users/neon/workspace/jp/lib/python3.6/site-packages/Django-1.11-py3.6.egg/django/core/management/base.py", line 330, in execute
output = self.handle(*args, **options)
File "/Users/neon/workspace/jp/lib/python3.6/site-packages/Django-1.11-py3.6.egg/django/contrib/auth/management/commands/createsuperuser.py", line 116, in handle
username = self.get_input_data(self.username_field, input_msg, default_username)
File "/Users/neon/workspace/jp/lib/python3.6/site-packages/Django-1.11-py3.6.egg/django/contrib/auth/management/commands/createsuperuser.py", line 192, in get_input_data
raw_value = input(message)
SystemError: <built-in function input> returned a result with an error set
答案 0 :(得分:0)
正如评论中所提到的, ctrl + j 和新终端中的运行命令都有效。