2016-06-12 1 views
0

私は、Visual Studio INV 2015DjangoのDB 2015

を参照してくださいスクリーンショットdbの同期をジャンゴしよう:

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ウィンドウからコマンドを実行しているようです。

答えて

0

ありがとうございます。 Windowsのコマンド(cmd)から実行する必要があります

+0

?どういう意味ですか。それはビジュアルスタジオで直接です。 Django管理コンソール – InfinityGoesAround

+0

これらのコマンドをWindowsコンソールから実行するとどうなりますか? –

0

私はこれに遭遇しました。プロジェクトのフォルダにWindowsのコマンドラインを開く必要があります。これを行う最も簡単な方法は、ファイルエクスプローラを開き、プロジェクト( "manage.py"ファイルを含む)を含むフォルダに移動することです。一旦そこに来たら、ヘッダーバーの "ファイル"メニューオプションをクリックし、 "コマンドプロンプトを開く"を選択してください。彼らは "manage.py migrate"を使用して動作するはずです。

関連する問題