beeware / bugjar

A interactive graphical debugger for Python code.
BSD 3-Clause "New" or "Revised" License
249 stars 31 forks source link

Bugjar doesn't work with Django #8

Open beatthem opened 10 years ago

beatthem commented 10 years ago

First, I must say thank you for creating so simple but powerful debugger for python.

Second. I have troubles with using Bugjar on Django (1.4.10) and Python 2.6. 1) There is "skip" parameter for Bdb in Python 2.7, but not 2.6 - so python 2.6 raises exception. 2) If I omit this parameter, django doesn't work well with Bugjar - If I let django run in debugger, but set breakpoint before, first few seconds (~20) Django application doesn't respond (It may be django startup time, don't know, but after I click few times Run - application starts to respond, BUT it doesn't stop at breakpoints. Maybe it new Django threading server? Even with --noreload option (bugjar manage.py runserver 8000 --noreload) it doesn't stop at breakpoints.

freakboy3742 commented 10 years ago

Thanks for the report @beatthem. There's two issues here -- Python 2.6 compatibility and Django compatibility. I'll retask this ticket to track the Django issue; I've opened a second issue (#9) to track the Python 2.6 issue.

As for the Django issue - There's definitely work to be done here. You need to be using "runserver --noreload --nothreading" to get Django support working at all; but even then, it's quite slow because of the verbosity of the line protocol.

This is something that I want to work on when I get a chance, but it's not a small job. I'll leave this ticket open as a marker for the problem.

beatthem commented 10 years ago

I've tried "bugjar manage.py runserver --noreload --nothreading" but it seems to ignore noreload/nothreading options, because I see 3 workers for bugjar itself and 3 workers for bugjar-net in htop (Ubuntu 13.04)

With simple "python manage.py runserver --noreload --nothreading" there is only 1 worker, as expected.

I've also noticed that 6 processes of bugjar appears before manage.py start to process command line options --noreload and --nothreading.

beatthem commented 10 years ago

I was able to start django server with noreloading and nothreading options; just more patience was needed.

bugjar-net creates 2 processes, I think for communication by sockets.