Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FLASK won't reload after changing code in VS Code

My editor is vs code, I am running flask with the below config

{
      "name": "Python: Flask",
      "type": "python",
      "request": "launch",
      "module": "flask",
      "env": {
        "FLASK_APP": "application.py",
        "FLASK_ENV": "development",
        "DATABASE_URL": "postgres://localhost/cs50w_project1_development",
        "FLASK_DEBUG": 1,
        "SECRET_KEY": "abcefefe"
      },
      "args": [
        "run",
        "--no-debugger",
        "--no-reload"
      ],
      "jinja": true
    },

It seems all good except flask won't hot reload when I am changing the code. E.G., add an action.

I have to manually reload the flask by clicking the restart button.

Is there any issue with my current config?

like image 351
new2cpp Avatar asked Dec 11 '18 13:12

new2cpp


1 Answers

Remove the --no-reload in the launch.json. It's a very old thread but posting the answer here for future visitors.

like image 121
Akbarsha Avatar answered Oct 19 '22 21:10

Akbarsha