2016-06-12 84 views
0

我嘗試Django的同步分貝INV的Visual Studio 2015年的Django DB 2015年

見截圖:

enter image description here

但後來我得到這個錯誤:

Python interactive window. Type $help for a list of commands. 
Executing manage.py syncdb 
Unknown command: 'syncdb' 
Type 'manage.py help' for usage. 
The Python REPL process has exited 
>>> python manage.py migrate 
Traceback (most recent call last): 
    File "D:\Program Files (x86)\Common7\IDE\Extensions\Microsoft\Python Tools for Visual Studio\2.2\visualstudio_py_repl.py", line 654, in run_one_command 
    self.execute_item() 
    File "D:\Program Files (x86)\Common7\IDE\Extensions\Microsoft\Python Tools for Visual Studio\2.2\visualstudio_py_repl.py", line 628, in execute_code_work_item 
    code = compile(self.current_code, '<stdin>', 'single', self.code_flags) 
    File "<stdin>", line 1 
    python manage.py migrate 
       ^
SyntaxError: invalid syntax 
>>> manage.py migrate 
Traceback (most recent call last): 
    File "D:\Program Files (x86)\Common7\IDE\Extensions\Microsoft\Python Tools for Visual Studio\2.2\visualstudio_py_repl.py", line 654, in run_one_command 
    self.execute_item() 
    File "D:\Program Files (x86)\Common7\IDE\Extensions\Microsoft\Python Tools for Visual Studio\2.2\visualstudio_py_repl.py", line 628, in execute_code_work_item 
    code = compile(self.current_code, '<stdin>', 'single', self.code_flags) 
    File "<stdin>", line 1 
    manage.py migrate 
        ^
SyntaxError: invalid syntax 

所以我已經讀過,你必須填寫:

python manage.py migrate 

但是,這也沒有奏效。

謝謝

回答

0

它看起來像你從交互式python窗口運行的命令。你應該從Windows命令運行它們(cmd)

+0

?你什麼意思。這是直接在視覺工作室。 Django管理控制檯 – InfinityGoesAround

+0

如果從Windows控制檯運行這些命令,會發生什麼情況? –

0

我遇到了這個問題。您需要打開項目文件夾中的Windows命令行。最簡單的方法是打開文件資源管理器並導航到包含項目的文件夾(包含「manage.py」文件)。一旦出現,請點擊標題欄中的「文件」菜單選項並選擇「打開命令提示符」。他們使用「manage.py migrate」應該可以工作。