2π
β
I donβt know something specific to VSCode but you can use Pudb to step into an external library like below:
1: Install Pudb by command below:
pip install pudb
2: Import set_trace function from Pudb module into the view.py or anywhere you want to debug like this:
from pudb import set_trace
3: Call set_trace() function anywhere of your code
4: Run python manage.py runserver by Pudb module like:
python -m pudb manage.py runserver
π€Ehsan Ahmadi
1π
In the latest VSCode and Python extension, open launch.json
and add new configuration with parameter "django": true, as in example:
{
"name": "Python: Django",
"type": "python",
"request": "launch",
"program": "${workspaceFolder}/server/manage.py",
"args": [
"runserver",
"0:8000"
],
"django": true
},
π€Spatz
- [Django]-Django-summernote image upload
- [Django]-My settings.py file in Django is getting too long. How do I split it into two?
- [Django]-Stop capturing any string based on / for urls in Django (regex)
- [Django]-How to configure Mathjax in Python Django
Source:stackexchange.com