简体   繁体   English

PyCharm:在Django模板中调试Javascript

[英]PyCharm: Debug Javascript in Django Template

I cannot figure out how to debug javascript, using PyCharm, in a Django template. 我无法弄清楚如何使用PyCharm在Django模板中调试javascript。

When I attempt to debug a template -- by using the context menu item Debug while in the template -- the debugger launches, chromium launches, and I see the following error message in the PyCharm debugger console: 当我尝试调试模板时 - 通过在模板中使用上下文菜单项Debug - 调试器启动,chrome启动,我在PyCharm调试器控制台中看到以下错误消息:

GET http://localhost:8000/login net::ERR_CONNECTION_REFUSED

Needless to say nothing shows up in the chromium window. 不用说,铬窗口中没有任何显示。

I've seen hints that I'm supposed to "open the generated file" from within the PyCharm debugger scripts tab. 我已经看到了我应该从PyCharm调试器脚本选项卡中“打开生成的文件”的提示。 But since chromium isn't loading anything there's nothing to open. 但由于铬没有加载任何东西,所以没有什么可以打开的。

I have the JetBrains chromium debugger installed and, so far as I can tell, running. 我安装了JetBrains铬调试器,据我所知,正在运行。

What's the procedure for debugging javascript in a Django template from within PyCharm? 在PyCharm中调试Django模板中的javascript的过程是什么?

Why not using a browser tool like firebug in browser or google chome debugging tools (depending on the browser you use), If your code is client side, since I assume that the server side part of the application is written in python scripts it's the easiest solution. 为什么不在浏览器或google chome调试工具中使用像firebug这样的浏览器工具(取决于你使用的浏览器),如果你的代码是客户端的,因为我认为应用程序的服务器端部分是用python脚本编写的,所以它是最简单的解。 I have also used JSDT in eclipse but it was not as convenient. 我也在eclipse中使用了JSDT,但它并不方便。

For the error you posted I think it's server-side error, check your views.py or an example from the django tutorial. 对于您发布的错误,我认为这是服务器端错误,请查看您的views.py或django教程中的示例。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM