Python 3.5与Django 1.8创建超级用户?

时间:2015-06-07 07:07:00

标签: python django python-3.x django-1.8

我有Windows 8,python 3.5和Django版本1.8.2

正如Django文档中所建议的,我尝试使用以下代码创建超级用户:

python manage.py createsuperuser

当我输入上述命令时,它会提示我输入用户名, 当我输入用户名时,它会提示我输入电子邮件,当我输入电子邮件地址而不是提示输入密码时,会显示以下错误。

G:\djangblog\mysite>python manage.py createsuperuser

Username (leave blank to use 'saphal'): admin

Email address: local@admin.com
Traceback (most recent call last):
  File "manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "E:\software_installed\python\lib\site-packages\django\core\management\__
init__.py", line 338, in execute_from_command_line
    utility.execute()
  File "E:\software_installed\python\lib\site-packages\django\core\management\__
init__.py", line 330, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "E:\software_installed\python\lib\site-packages\django\core\management\ba
se.py", line 390, in run_from_argv
    self.execute(*args, **cmd_options)
  File "E:\software_installed\python\lib\site-packages\django\contrib\auth\manag
ement\commands\createsuperuser.py", line 50, in execute
    return super(Command, self).execute(*args, **options)
  File "E:\software_installed\python\lib\site-packages\django\core\management\ba
se.py", line 441, in execute
    output = self.handle(*args, **options)
  File "E:\software_installed\python\lib\site-packages\django\contrib\auth\manag
ement\commands\createsuperuser.py", line 124, in handle
    password = getpass.getpass()
  File "E:\software_installed\python\lib\getpass.py", line 104, in win_getpass
    msvcrt.putwch(c)
AttributeError: module 'msvcrt' has no attribute 'putwch'

*我在E盘上安装了python,并在G盘上安装了我的工作文件夹。

1 个答案:

答案 0 :(得分:2)

这是known bug in Python并已解决。

您可以升级到最新的3.5版本;或降级至3.4.3(推荐版本)。

相关问题