这里可能发生了什么?这是我的两台独立 Mac 上的问题 - 一台 Eclipse 安装和一台 Aptana Studio。在我第一次同步数据库时回答“是”以创建超级用户后,我收到了这些错误。
在 PyDev 之外(通过终端等)执行 Sync db 似乎工作正常。
您刚刚安装了 Django 的身份验证系统,这意味着您没有定义任何超级用户。您想现在创建一个吗?(是/否):是 回溯(最后一次调用):文件“/Users/mac2/Documents/workspace/helloworld/manage.py”,第 10 行,在 execute_from_command_line(sys.argv) 文件“/Library/Frameworks/ Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/ init .py”,第 443 行,execute_from_command_line 实用程序.execute() 文件“/Library/Frameworks/Python.framework/版本/2.7/lib/python2.7/site-packages/django/core/management/init.py”,第 382 行,在执行 self.fetch_command(subcommand).run_from_argv(self.argv) 文件“/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core /management/base.py",第 196 行,在 run_from_argv self.execute(*args, ** options.dict) 文件“/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/base.py”,第 232 行,执行输出 = self.handle(*args , **options) 文件“/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/base.py”,第 371 行,在句柄中返回 self.handle_noargs (**选项)文件“/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/commands/syncdb.py”,第110行,在handle_noargs emit_post_sync_signal( created_models,详细程度,交互式,db)文件“/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/management/sql.py”,第189行,在emit_post_sync_signal交互=交互式,db = db)文件“/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/dispatch/dispatcher.py”,第 172 行,在发送响应 = 接收器(信号 = 自我,发件人 = 发件人,* *命名)文件“/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/contrib/auth/management/init .py",第 73 行,在 create_superuser call_command("createsuperuser", interactive=True, database=db) 文件“/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django /核心/管理/初始化.py”,第 150 行,在 call_command 返回 klass.execute(*args, **defaults) 文件“/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/core/ management/base.py”,第 232 行,在执行输出 = self.handle(*args, **options) 文件“/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ django/contrib/auth/management/commands/createsuperuser.py”,第 70 行,在句柄 default_username = get_default_username() 文件“/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ django/contrib/auth/management/ init .py”,第 105 行,在 get_default_username default_username = get_system_username() 文件“/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/django/contrib/auth/management/init .py",第 85 行,在 get_system_username return getpass.getuser().decode(locale.getdefaultlocale()[1]) TypeError: decode() argument 1 must be string, not None Finished "/Users/mac2/Documents/工作区/helloworld/manage.py syncdb”执行。