Debugging JavaScript with Flask and PyCharm
I just installed the professional version of PyCharm for its Flask features, but I'm having a lot of issues getting anything JavaScript related working.
Firstly, is there any way of getting the browser to open when you run the flask project? There doesn't seem to be a Flask run configuration, which means you have to use the default Python configuration, and that doesn't have the option to run a browser. I tried making a JavaScript Debug project that runs the server as a Before Launch command, but it still doesn't open the browser (either Chrome or Firefox)
Secondly, how do I get PyCharm to hit the JavaScript breakpoints? Even if I manually browse to the flask server ( http://localhost:5555/
), Intellij doesn't hit breakpoints in my JavaScript, even though the JetBrains plugin is installed (again, in both Firefox and Chrome). I suspect this may be related to the fact that PyCharm doesn't open the browser, which is why I mentioned that as my first point.
Can anyone with experience in PyCharm or IntelliJ help me out?
Just solved this problem.
You need some setup steps.
My prerequisites:
PyCharm on my local laptop
I'm developing on remote virtual machine (droplet DO, Ubuntu)
a. Run->Edit configuration
b. Add->JavaScript debug
c. Specify you URL as real url from web-browser like: http://YOUR_IP:YOUR_PORT/directory/category
d. Specify File/Directory of HTML template and remote URL where your template located.
e. Debug it.
f. Profit ! :)
PS So lovely evaluate JavaScript variables from familiar PyCharm tool :)
P.S2: Almost forgot: Need install Chrome extension: https://www.jetbrains.com/help/pycharm/2016.3/debugging-javascript.html#d615717e345
链接地址: http://www.djcxy.com/p/44946.html上一篇: 用PyCharm调试Popen子进程