how can i debug my django code ?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With