pycharm and flask autoreload and breakpoints not working pycharm and flask autoreload and breakpoints not working flask flask

pycharm and flask autoreload and breakpoints not working


I'm going to start with the short answer: No, what you want cannot be done with any releases of PyCharm up to 4.0.1.

The problem is that when you use the reloader the Flask application runs in a child process, so the PyCharm debugger is attached to the master process and has no control over the child.

The best way to solve this problem, in my opinion, is to ask Jetbrains to build a "restart on change" feature in their IDE. Then you don't need to use Werkzeug's reloader at all and you get the same functionality direct from PyCharm.

Until Jetbrains decides to implement this, I can share my workaround, which is not terribly bad.

  • In the "Edit Configurations", set the configuration you are going to use to "Single Instance only" (check box in the top right of the dialog box)
  • Make sure the configuration is the active one.
  • Configure your Flask app to not use the Werkzeug reloader.
  • Press Ctrl-D to start debugging (on Mac, others may have a different shortcut)
  • Breakpoints should work just fine because the reloader isn't active.
  • Make any code changes you need.
  • When you are ready to restart, hit Ctrl-D again. The first time you do it you will get a confirmation prompt, something like "stop and restart?". Say yes, and check the "do not show again" checkbox.
  • Now you can hit Ctrl-D to quickly restart the debugger whenever you need to.

I agree it is not perfect, but once the Ctrl-D gets into your muscle memory you will not even think about it.

Good luck!


I found that in PyCharm 2018.1.2 there is FLASK_DEBUG checbox in run configuration:enter image description here

With this after making some changes, saving file triggers reload action.


In my setup, I'm debugging the flask app by running a main.py file which sets some configuration and calls app.run(). My python interpreter is set up in a Docker container.

My issue was that I needed to check Run with Python console.