Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

debugger for django

how can i debug my django code ?

like image 957
Bunny Rabbit Avatar asked Nov 22 '25 09:11

Bunny Rabbit


1 Answers

Generally, I use django-debug-toolbar for debugging django-specific stuff.

pdb is useful for lower-level shell debugging, when you're using runserver. Though I prefer to use ipython (pip install ipdb, then import ipdb; ipdb.set_trace(), like you would with pdb)

There's also werkzeug, which, when combined with django-extensions' runserver_plus command, will allow you to open a web-based python shell on error pages:

This item requires that you have the Werkzeug WSGI utilities (version 0.3) installed. Included with Werkzeug is a kick ass debugger that renders nice debugging tracebacks and adds an AJAX based debugger (which allows to execute code in the context of the traceback’s frames). Additionally it provides a nice access view to the source code.

like image 143
eternicode Avatar answered Nov 24 '25 21:11

eternicode



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!