Reputation: 453
I would like to ask you about the debug workflow in PyCharm.
Firstly, I'm really new in pycharm and python. I have created a flask hello world app and click on the run button in the toolbar.
In the console, I got a link to localhost where the app is running. In the browser I saw "Hello world page". Then I changed Hello world title in the code on something else, and I refreshed the browser. But the change wasn'T reflected.
To be reflected, I have to stop the app instance and again run. Then I see the changes.
I would like to ask you, is it possible to reflect changes automatically? Or it's necessary to stop and run after every change.
Really thanks and sorry if the question is stupid:) I'm really new.
Upvotes: 2
Views: 788
Reputation: 474191
It's not really about pycharm, it's about flask itself. Setting debug
to True
should do the trick:
The debug flag. Set this to True to enable debugging of the application. In debug mode the debugger will kick in when an unhandled exception occurs and the integrated server will automatically reload the application if changes in the code are detected.
app.run(debug=True)
Upvotes: 4