2017-12-11 12 views
0

VSCODEエディタからDjangoプロジェクトを実行する方法はありますか?VSCODEからDjangoプロジェクトを実行

現在、私はプロジェクトを実行するためにウィンドウのCMDを使用しています。私がVSCODEで '実行'ボタンを押すたびに、プロジェクトは実行されません。

pyCharmでは、スクリプトパラメータの設定に 'runserver'を追加できます。 VSCODEのようなものがありますか?

UPDATE

私はVSCODEターミナルでこれを取得しています:あなたはappropriteコマンド

Ctrl + Shift + pを提供してください別の環境であれば

Type 'manage.py help <subcommand>' for help on a specific subcommand. 

Available subcommands: 

[auth] 
    changepassword 
    createsuperuser 

[contenttypes] 
    remove_stale_contenttypes 

[django] 
    check 
    compilemessages 
    createcachetable 
    dbshell 
    diffsettings 
    dumpdata 
    flush 
    inspectdb 
    loaddata 
    makemessages 
    makemigrations 
    migrate 
    sendtestemail 
    shell 
    showmigrations 
    sqlflush 
    sqlmigrate 
    sqlsequencereset 
    squashmigrations 
    startapp 
    startproject 
    test 
    testserver 

[sessions] 
    clearsessions 

[staticfiles] 
    collectstatic 
    findstatic 
    runserver 

[Done] exited with code=0 in 9.449 seconds 

答えて

0

私は、Linuxによ>python: Select Interpreter Djangoがインストールしたvirtualenvを選択してください。

とデバッグに行く(+ Shift + dCtrl)及びこれらの...あなたの答えのための

{ 
    // Use IntelliSense to learn about possible attributes. 
    // Hover to view descriptions of existing attributes. 
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 
    "version": "0.2.0", 
    "configurations": [ 
     { 
      "name": "Django", 
      "type": "python", 
      "request": "launch", 
      "stopOnEntry": true, 
      "pythonPath": "${config:python.pythonPath}", 
      "program": "${workspaceRoot}/manage.py", 
      "cwd": "${workspaceRoot}", 
      "args": [ 
       "runserver", 
       "--noreload", 
       "--nothreading" 
      ], 
      "env": {}, 
      "envFile": "${workspaceRoot}/.env", 
      "debugOptions": [ 
       "WaitOnAbnormalExit", 
       "WaitOnNormalExit", 
       "RedirectOutput", 
       "DjangoDebugging" 
      ] 
     } 
    ] 
} 
+0

感謝。私はまだVSCODEからプロジェクトを直接実行することはできません。私はVSCODE端末で何を得ているのかを示すために質問を更新しました。 – Filipe

+0

コンピュータでこのスニペットを使用しているため、うまくいくはずです –

関連する問題