2016-01-13 83 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