vim-vebugger icon indicating copy to clipboard operation
vim-vebugger copied to clipboard

Doest it work with Django?

Open sidneijp opened this issue 7 years ago • 6 comments

Hi,

I've tested it with Django Web Framework (Python) but I can get it to work properly so far. By "work with Django" I mean to use the debugger for the python manage.py runserver command that starts a http webserver for development purpose, so the process keep listening for request. It seems to work on the server initialization, but do not stop on breakpoints for code executed on the requests/response cicle.

Did someone get it to work already in such case?

Thanks a lot!

sidneijp avatar Apr 17 '18 19:04 sidneijp

I never tried using it with Django...

idanarye avatar Apr 17 '18 20:04 idanarye

Hi, I have the same problem, if I do this manually (import pdb; pdb.set_trace()) it works. @idanarye is there any chance you will look into this? Or at least give me a hint where the problem may be? Thanks

drozdowsky avatar Sep 14 '18 13:09 drozdowsky

This seems to be a limitation of Django and PDB themselves. I found a package that allows using PDB with django without manually adding pdb.set_trace(): https://github.com/HassenPy/django-pdb. I checked it with Vebugger and it works.

Note that you need to pass an argument either in the command line or in the HTTP request. It's all in the readme of that package.

idanarye avatar Sep 14 '18 14:09 idanarye

Thanks for the reply. Could you elaborate more on the limitation please? django-pdb unfortunately is not enough for me.

Thanks

drozdowsky avatar Sep 14 '18 16:09 drozdowsky

Never looked that much into it, since I'm not using Django myself, but I suspect that PDB does not support multithreading.

idanarye avatar Sep 14 '18 16:09 idanarye

At least, not unless you call pdb.set_trace() manually in the thread you want to debug.

idanarye avatar Sep 14 '18 16:09 idanarye