2014-03-27 11 views
1

創建超級用戶每次我試圖創建一個數據庫出現這種情況無法在Django

C:\Users\Admin8085\Desktop\src>python manage.py syncdb 
Creating tables ... 
Creating table django_admin_log 
Creating table auth_permission 
Creating table auth_group_permissions 
Creating table auth_group 
Creating table auth_user_groups 
Creating table auth_user_user_permissions 
Creating table auth_user 
Creating table django_content_type 
Creating table django_session 

You just installed Django's auth system, which means you don't have any superuse 
rs defined. 
Would you like to create one now? (yes/no): yes 
Please enter either "yes" or "no": yes 
Please enter either "yes" or "no": yes 
Please enter either "yes" or "no": yes 
Please enter either "yes" or "no": 'yes' 
Please enter either "yes" or "no": yes 
Please enter either "yes" or "no": 
+1

我沒有這個行爲的答案,但你可以做的一件事是,在這裏說'不',然後做'python manage.py createsuperuser' – karthikr

+0

要麼我輸入'是'或'否'沒有什麼工作 – Yogeshwar

+0

中止這個過程,並執行'python manage.py syncdb --noinput'然後,'python manage.py createuser'。我的猜測是,它與數據庫寫入權限或某事有關 – karthikr

回答

0

哈,我敢打賭,它與字符集做。如果你運行這個,你會得到什麼?

python -c "import sys; print(sys.getdefaultencoding())" 

如果您的系統的編碼是從Python,在使用Python然後「是」的一個不同可能會在終端不等於「是」。 :-O

+0

請參閱關於如何更改Windows字符集的討論:http://stackoverflow.com/questions/14109024/how-to-make-unicode-charset-在-CMD-EXE-由默認 –