Can I debug Flask applications in IntelliJ? [duplicate]
Can I debug Flask applications in IntelliJ? [duplicate]
This question already has an answer here:
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.
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
2 Answers
2
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
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 at 0:08
resp = generateKey(request.get_json())
request.get_json()
Evaluate Expression
I dont think that is possible in Pycharm. You can use either the Expression Mode or Code Fragment Mode. to evaluate expressions. Have you tried the Code Fragment Mode?
– Angela
Aug 24 at 0: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 at 1:08
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.
You want to use this feature in PyCharm?
– Pradeepb
Aug 24 at 10:35