29π
are you using a launch configuration to run the debugger? i had the same issue and resolved by adding "justMyCode": false
inside the launch.json for the proper entry.
8π
I was only able to add Breakpoints to 3rd party libraries when I set 2 options:
-
on the launch.json file:
add "justMyCode": false to the configuration. -
on Settings>Features>Debug
Turn on the option Allow Breakpoints Everywhere -
(alternative to 2.) on the file settings.json
add "debug.allowBreakpointsEverywhere": true
Tested on: version: 1.63.2
- [Django]-What is the difference between null=True and blank=True in Django?
- [Django]-How to delete old image when update ImageField?
- [Django]-How to add custom field in ModelSerializer?
2π
Have you tried left hand side green button on the top instead of clicking the one on the right? it works for me.
- [Django]-Importance of apps orders in INSTALLED_APPS
- [Django]-Group by Foreign Key and show related items β Django
- [Django]-How to add data into ManyToMany field?
1π
Tools β> Options β> Python β> Debugging β> Check : βEnable debugging of the Python standard libraryβ
- [Django]-How to detect Browser type in Django?
- [Django]-Django ALLOWED_HOSTS vs CORS(django-cors-headers)
- [Django]-How can I exclude South migrations from coverage reports using coverage.py
0π
You need to set "justMyCode": true
in your debug configuration as this is third-party code which is excluded by default.
- [Django]-Django: How to access original (unmodified) instance in post_save signal
- [Django]-Render HTML to PDF in Django site
- [Django]-How to create an empty queryset and to add objects manually in django
0π
If you work with Typescript, and have tsconfig.json file β> Try setting:
"sourceMap": true
That worked for me
- [Django]-How to fetch only specific columns of a table in django?
- [Django]-Assign variables to child template in {% include %} tag Django
- [Django]-How to 'bulk update' with Django?
0π
In addition to what was mentioned in https://stackoverflow.com/a/70917357/2475775 I had to
-
Set
"purpose": ["debug-test"]
inlaunch.json
to set which config was used.source: https://code.visualstudio.com/docs/python/debugging#_purpose
Setting the option to debug-test, defines that the configuration should be used when debugging tests in VS Code.
-
Delete
.cpython-39-darwin.so
files.One of the external libraries I was using had
.cpython-39-darwin.so
versions of the python files. I suspect these are compiled Python files and it was using them instead of the.py
files, and thus not seeing the breakpoints. I deleted them withcd path/to/site-packages/problem-package/ find . -name '*.so' # to see if the files exist find . -name '*.so' -delete # to delete the .so files
I was using VS Code 1.77.3 on OSX 13.3.1
- [Django]-How to reverse a name to a absolute url in django template?
- [Django]-Django Queryset only() and defer()
- [Django]-Django Admin linking to related objects
0π
.NET Core Solution
In my case none of the solutions above worked. VSCode suggested to add this line to my launch.json inside the related config which fixed the issue.
"requireExactSource": false
Complete config:
{
"name": ".NET Core Attach",
"type": "coreclr",
"request": "attach",
"requireExactSource": false
}
- [Django]-Testing custom admin actions in django
- [Django]-Django and client-side javascript templates
- [Django]-Automated django receive hook on server: respond to collectstatic with "yes"
0π
What worked for me was:
- Rename file (package I try to debug has name like "pi.py" and in editor it showed "β¦pi.py is overriding the stdlib module" error. When I tried to debug pi.py straightly (not main file that imports "pi.py"), my breakpoints went greyed out, with message that it was turned off by filters. I copy content of "pi.py" to "pi2.py" file, and on this one breakpoints worked. Sounds like magic.
- Setting
"justMyCode":false
in launch.json
Also advice, given by MTex above is useful.
- [Django]-Get date from a Django DateTimeField
- [Django]-Django: list all reverse relations of a model
- [Django]-Django 1.5 custom User model error. "Manager isn't available; User has been swapped"