2016-01-13 87 views
1

的python manage.py createsuperuser“命令给我这个错误:'蟒蛇manage.py createsuperuser' 错误

Superuser creation skipped due to not running in a TTY. You can run manage.py createsuperuser in your project to create one manually.

通过源看,即createsuperuser.py,它捕获的NotRunningInTTYException:

except NotRunningInTTYException: 
    self.stdout.write(
     "Superuser creation skipped due to not running in a TTY. " 
     "You can run `manage.py createsuperuser` in your project " 
     "to create one manually." 
    ) 

任何人都知道我可以如何解决这个错误?如果它有什么区别,我的安装过程是一个头痛的问题......让'python manage.py runserver'给了我一个美好的一天。也许我没有正确配置任何东西......使用Windows。

回答

2

我相信你试图在IDE或其他不是TTY的环境中运行它。 Django预计该命令将从TTY兼容的shell运行。

在编辑器/ IDE外部的Windows命令提示符处运行此命令。它应该工作。

要知道更多关于TTY:

+0

我运行的Git bash命令行里的命令。我正在使用PyCharm IDE,但是我没有使用它提供的终端。 – Lansana

+0

你可以请尝试Windows提示没有Git bash? – masnun

+0

啊,真棒,一个作品!嗯,为什么它不与Git Bash合作?前几天我和Vagrant有同样的问题,关于TTY,但我也在使用Git Bash,也许普通的Windows CMD也会解决这个问题。 – Lansana