PyCharm: Debug Javascript in Django Template - javascript

I cannot figure out how to debug javascript, using PyCharm, in a Django template.
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:
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. 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.
What's the procedure for debugging javascript in a Django template from within PyCharm?

Set up a debug configuration for Javascript (not Remote Firefox/Remote Chrome as the documentation might lead you to). Set the URL to the entrypoint of your application that renders the template and run this config. It should launch a browser and stop at any breakpoints you set in your javascript in pycharm.

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.
I have also used JSDT in eclipse but it was not as convenient.
For the error you posted I think it's server-side / networks error, check your views.py or an example from the django tutorial to see if it is exposed in WSGI (django default web server ).

Related

Cannot debug some of the code in process unknown see below for status. JavaScript

For one of my web projects (which use .Net Framework v4.7.2) and jQuery, if I run it in the debug mode in the Visual Studio 2019, then I'm getting message below.
Cannot debug some of the code in process unknown see below for status [{GUID}].
JavaScript (Chrome) code succeeded.
{Another GUID} code failed.
Debugger is not registered.
Debugging continue normally after I click OK. I do not observe this pop up at other web projects at the same computer, so probably it's related to the solution/project.
How to get rid of this annoying pop-up?

Opening Chromium DevTools in production builds of Electron apps without source code or build process

Is there a way to open devtools on production builds of Electron that were packaged and distributed to you?
For instance, I'd like to poke around Slack's app. I know that it's built in Electron, and I'd like to open devtools to see how some parts of it are built.
On macOS I've tried:
ELECTRON_ENV=development /Applications/Slack.app/Contents/MacOS/Slack --debug --auto-open-devtools-for-tabs
as well as the usual key combination of Cmd+Option+I and checking for debug menus/views.
None of these seem to make a difference.
Note that there are already a few solutions that recommend you do it programmatically by injecting:
remote.BrowserWindow.getFocusedWindow().webContents.openDevTools()
However I can't do that because I don't have access to the source code or the original build process. Is there a way to trigger devtools externally?
The most promising way I've seen so far is remote-debugging-port but I'm not sure it works with production builds.
The way to do this without third-party code is indeed using the --remote-debugging-port flag.
Using Signal as an example, take the following steps:
start the application from the CLI
signal-desktop --remote-debugging-port
Open the debugging URL in a Google Chrome browser (in this case http://localhost:39733/), this will open a page with the app name on it .
Click the to open a screen were you can click around to use the app and see output in the devtools
Alternatively, you can open chrome://inspect/#devices in the Google Chrome browser and click "inspect" (underneath the app name) to open the same window

Eclipse Neon - Javascript Console Output not showing

I'm developing a PHP project which utilizes Javascript with jquery for a number of functions (particularly authentication/api calls). The long and short of my problem is that I cannot get Javascript console logs to appear in the eclipse console. At all.
Not only this, but some of my functions work...sometimes. I'm trying to debug the cause of this, but without any form of logging occurring, it's extremely difficult.
How do I configure my Eclipse Neon PHP project to output Javascript console logs?
Edit: The project is a PHP Web Application. I'm currently running a local PHP server for the project via the php command php -S localhost:8000
The JavaScript built-in function console.log(message); logs the given message to the console in the browser window, which is accessible via the developer tools of your browser.
If you open your webapp via the built-in Eclipse browser, you do not have access to those tools, just because Eclipse is using a closed, minified browser (just like the browser widget for QT or Visual C# WinForms or even a distributed Electron app).
Using the Eclipse browser is not really helpful when trying to debug webapps, because you can't even see loading times of the pages and so on.

QtWebKit or Server side? Can't translate xml: ReferenceError: Can't find variable: XSLTProcessor

I need to open a webpage inside a QWebView in my Qt Widgets Application.
The web works fine, except one part, where some files are not downloading from the server.
I inspected the QWebView and I found that error in the title...
It seems weird, because I tried to compile my app in linux with same Qt version and it works fine, no error in Web Inspector console... I tried compiling with MinGW32 and also with MSVC 2013 with same results.
I tried the same webpage with Qupzilla WebBrowser and it works!!, even in Windows (so I am afraid that is Qt setting in my app, that is only needed in Windows environment, but I couldn't find for it in the QupZilla sources...)
Error detail in windows:
(In linux the same action produces no error)
Top: Linux build, processed 45 requests, Windows build(bottom) stopped at 15 requests..., same code:
Another things I tried:
- Changing user agent
- Playing with QWebSettings
- And maybe another unuseful tries.
Any clue to get my page fully loaded into the Windows QWebView?

Remote debug Script Code VS2010

Is it possible to remote debug script code with Visual Studio 2010?
I have a JavaScript issue which occurs only on IE6/IE7. I’m developing on Windows 7 (64-bit) so can only install IE6 and 7 as Virtual Machines.
I’ve setup remote debugging between my development machine and the Virtual Machine and can successfully attach to the IEXPLORE process but I cannot debug it as Script code.
In VS2010 from Debug | Attach to Process, when I try to Attach to the IEXPLORE process on the remote machine VS2010 listed it as x86 type (Script is not displayed). And when I press Select to select the Code Type the choices do NOT include the script option (only, Managed, Native, Silverlight, T-SQL, Workflow).
Thus, although the debugger is attached to the remote process, it is not debugging the script so my breakpoints do not hit.
I have enabled debugging in Internet Explorer on the Virtual Machine.
This page http://msdn.microsoft.com/en-us/library/bb385613.aspx suggests that remote debugging of Script code is possible. However I cannot get it up and running. Any ideas would be greatly appreciated.
Check out this project, which lets you run IE6, 7, 8, etc together:
http://www.my-debugbar.com/wiki/IETester/HomePage
It's not 100% perfect, but it's always worked for my purposes.
Here's a trick that works with Visual Web Developer Express.
Open a local page in VS and start to debug it(or hit F5)
IE should popup and open this page.
Type in IE's address bar the url of the remote site.
Go to VS and you should see now a list of remote files in the Solution Explorer pane
Put a breakpoint in a remote file, where you want to stop it.
And refresh the page in IE.
You should hit the breakpoint.
I had this problem until I discovered that script debugging was disabled in IE on the remote machine. I re-enabled it using this work around and "script" now appeared in the "Type" column when attaching to process on the remote machine.

Categories