0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

VSCodeでのFlaskアプリのデバッグ~忘備録~

Last updated at Posted at 2022-02-11

前回の Flask 導入 の続き。
VSCode での Flask アプリのデバッグを行う。

  • 手順1
    実行とデバッグをクリックして、launch.json ファイルを作成。

このとき、Debug Configuration として Flask を選択。
そして、application へのパスを入力(ここでは前回のファイルを踏襲し hogehoge.py).

  • 手順2
    すると次のようにlaunch.json ファイルが作られる。
launch.json
{
    // 省略
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: Flask",
            "type": "python",
            "request": "launch",
            "module": "flask",
            "env": {
                "FLASK_APP": "hogehoge.py",
                "FLASK_ENV": "development"
            },
            "args": [
                "run",
                "--no-debugger"
            ],
            "jinja": true
        }
    ]
}
  • 手順3
    hogehoge.py ファイルに戻り適当にブレークポイントを作ってやるなど、デバッグができる。

次回は、前回の Flask 導入 の補足 Flaskー補足ー

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?