【问题标题】:Python 3.5 with Django 1.8 Create super user?Python 3.5 和 Django 1.8 创建超级用户?
【发布时间】:2015-08-21 20:22:18
【问题描述】:

我有 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 盘上有我的工作文件夹。

【问题讨论】:

  • 3.5 甚至还没有发布(并且不会再发布几个月)。您可能会发现更多错误。为什么要使用预生产版本?

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


【解决方案1】:

这是known bug in Python,已解决。

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

【讨论】:

  • 感谢您的回复。抱歉回复晚了!!
猜你喜欢
  • 1970-01-01
  • 2021-10-13
  • 1970-01-01
  • 2023-03-13
  • 2017-11-11
  • 1970-01-01
  • 2012-12-13
  • 2021-11-16
  • 1970-01-01
相关资源
最近更新 更多