Running PyCharm 4.5.3 Build #141.1899 Professional Edition and licensed. I run a Flask app using the profiler command using a configuration similar to:
python app.py
which looks like:
def create_app():
app = Flask(__name__, static_folder='static')
app.register_blueprint(
consumer_v1.bp,
url_prefix='/consumer/v1')
return app
app = create_app()
if __name__ == '__main__':
app.run(debug=True, host='0.0.0.0', port=5001)
When I goto "Run -> Profile App" I see the following on the console:
/Users/james/.virtualenvs/trustmile-api/bin/python /Applications/PyCharm.app/Contents/helpers/profiler/run_profiler.py 127.0.0.1 49537 /Users/james/Documents/workspace/trustmile-backend/trustmile/api_stubs/api_stubs/__init__.py
Starting cProfile profiler
2015-09-01 07:00:25,717 INFO [werkzeug][MainThread] * Running on http://0.0.0.0:5001/ (Press CTRL+C to quit)
2015-09-01 07:00:25,723 INFO [werkzeug][MainThread] * Restarting with stat
2015-09-01 07:00:32,801 INFO [werkzeug][Thread-1] 127.0.0.1 - - [01/Sep/2015 07:00:32] "POST /consumer/v1/account/password HTTP/1.1" 403 -
Snapshot saved to /Users/XXXX/Library/Caches/PyCharm40/snapshots/trustmile-backend5.pstat
Process finished with exit code 0
However nothing is shown in the UI as shown below.
Any help greatly appreciated.
Start the profiling sessionon the main toolbar and select Profile <current run. debug configuration name> or select the same command from Run in the main menu. Ensure that the profiler has started in the dedicated tab of the Run tool window. Saves the profiling results in the <project name>.
The default value is 'development'. Select this checkbox to enable the built-in Flask debug mode. With this mode, the development server will be automatically reloaded on any code change enabling continuous debugging.
To fix this I simply installed yappi instead of the default python profiler.
pip install yappi
I hope this works for you too!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With