2

I know how to debug a flask application in Pycharm. The question is whether this is also possible in IntelliJ.

I have my flask application debugging in Pycharm but one thing I could do in IntelliJ was evaluate expressions inline by pressing the alt + left mouse click. This isn't available in Pycharm so I wanted to run my Flask application in IntelliJ but there isn't a Flask template.

Is it possible to add a Flask template to the Run/Debug configuration? I tried looking for a plugin but couldn't find that either.

n00b
  • 5,843
  • 11
  • 52
  • 82
  • You want to use [this](https://www.jetbrains.com/help/pycharm/evaluating-expressions.html?keymap=primary_default) feature in PyCharm? – Pradeepb Aug 24 '18 at 10:35

2 Answers2

0

Inline values are enabled by default in PyCharm. Are you running a debug session? Refer to this post --> Inline Values View

You can also create run/debug configurations for your Flask Server ---> Run-Debug Configuration Flask Server You have a lot of options to configure your log output, your launch options etc.

Alternatively you can always use the pdb library

import pdb
.....
......
pdb.set_trace()  #begin tracing
Angela
  • 1,671
  • 3
  • 19
  • 29
  • I'm actually referring to the ability to evaluate function calls so I can see what parts of the function is evaluating to. E.g. if I have `resp = generateKey(request.get_json())`, I only wanted to evaluate `request.get_json()` inline. I know I can bring up the `Evaluate Expression` dialog but I'd like to see if it can be done inline too – n00b Aug 24 '18 at 00:08
  • I dont think that is possible in Pycharm. You can use either the [Expression Mode or Code Fragment Mode](https://www.jetbrains.com/help/pycharm/evaluating-expressions.html/). to evaluate expressions. Have you tried the Code Fragment Mode? – Angela Aug 24 '18 at 00:46
  • Yeah I've used the Expression Mode to evaluate expressions. I wanted to see if I could skip that and evaluate expressions inline. – n00b Aug 24 '18 at 01:08
0

Yes, you can. Just setup the proper parameters for Run script into PyCharm IDE. After that you can debug it as usual py script. In PyCharm you can evaluate any line in debug mode too.