> This question is aimed at those of you who, like me, come from a Java > and C++ background and are used to being able to debug things with a > debugger - setting breakpoints, stepping through code, evaluating > expressions, etc. What do you find to be the most productive approach > to debugging Django apps?
Using the development server, I tend to use either the "print my_var" method to dump text to the console, or I use Python's built-in "pdb" (Python DeBugger) module import pdb; pdb.set_trace() PDB isn't for everybody (heck, it may not be for a LOT of people, as it's certainly no point-and-click interface), but it does allow me to step through my code, set breakpoints, inspect variables and change values on the fly. The only trouble I've had is that something in the mix of dev-server + screen + pdb occasionally gets confused and I lose pdb output (it sits waiting for input, but the output vanishes). Usually this happens to me when I've entered pdb, resumed running, and then fall back into pdb. Not 100% of the time, and just restarting the dev-server is usually enough to give it the kick it needs. For the margin between the dev. server and a sandbox/production server where subtle differences crop up, logging is your friend. There's the occasional gotcha where the Django development server behaves differently from the actual deployment environment, and logging will save you here. At least that's been my experience. -tim --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---