.vscodeフォルダを新規作成。以下の二つのファイルを新規作成して.vscodeフォルダ内に保存
-
launch.json★デバッグ実行ファイル -
settings.json★vscodeの設定ファイル
※ブレークポイントでストップできる最小限の構成を紹介するのでデバッグ実行ファイル.launch.jsonの中身のみ掲載
launch.json
{
"version": "0.2.0",
"configurations": [
{
"name": "Python: Django",★デバッグ実行名(任意)
"type": "python",★使用するデバッガ
"request": "launch",★デバッグの実行モード※1
"program": "${workspaceFolder}/manage.py",★デバッグ対象のプログラムのパス
"console": "integratedTerminal",結果の出力コンソール
"args": [★python mange.pyに続く引数
"runserver",
"0.0.0.0:8000",
"--noreload",
// "--nothreading"
],
"django": true,
"stopOnEntry": false,
"justMyCode": false※2
},
{
"name": "Python",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal"
}
]
}
※1 launchはプログラムの起動時からデバッグ開始, attachは起動しているプログラムに対してデバッグをする
※2 Breakpoint in file excluded by filters. Note: may be excluded because of "justMyCode" option (default == true). Try setting "justMyCode": false in the debug configuration (e.g., launch.json).
の警告がでてブレークポイントで止まらない現象が起こっていたため
justMyCode : falseで対応