Run Flask with Debug in PyCharm
In flask way of starting things there is another approach however. Here it is in Flask Docs.
It states to set a variable FLASK_APP and then run a flask run command. This will confuse running a python script way of a project being run. Thus to fix this one needs to set a path to flask binary file. It usually is within a virtual environment binary directory, place where your python interpreter resides.
So to set debugging one needs to set path to script binary one needs:
- Script: /path/to/env/bin/flask
- Script parameters: run
- Environment variable FLASK_APP=app.py
- Environment variable FLASK_DEBUG=True
- Set working directory back to your app path (It changes automatically according to script being set)
So my will look something like this: