How to debug flask custom commands in PyCharm?


I have created a custom command in Flask, that I am able to run via flask my_command in the Terminal.

The project has the following run/debug config:

Running it (either via 'flask run' in the terminal or PyCharm run) works fine, I am able to access defined website endpoints in the browser. When debugging, it opens the server and breakpoints defined in views or libraries used in views work, the debugger stops at them.

However, when running custom commands from the terminal, the breakpoints defined in the command or in libraries used in that command do not work. Do I need a custom configuration to debug terminal custom commands? If so, how would they look like?.

1 comment
Comment actions Permalink

Hi George Irimiciuc! At the moment we don't have a special support for custom Flask commands. Could you please create an issue in our issue tracker( and attach a sample project? Thank you!


Please sign in to leave a comment.