On 1/22/07, rzimerman <[EMAIL PROTECTED]> wrote:
>
>
> What's the best way to do debugging in Django? Usually when I program,
> I use  "print" statements to identify problems. But Django seems to
> surpress all output to stdout.


The best way, no doubt, is a graphical debugger that remotely connects to a
running django. I am still looking for such beast (for linux
environment...perhaps pydev is able to do that)

In the meantime I usually use two aproaches:
1) a dev server with print statements in the console
2) I have the base template ready to dump debug data as javascript block,
basically sentences calling firebug's extension console.log method. The
debugging code only runs when a specific parameter (__debug__=1) is added to
the URL. You need collect data in the problematic view and add it to the
context, then cycle over it on the template generating the javascript code.
For IE lovers (or firebug haters) the same approach works dumping the data
in a hidden HTML element. Valid for any server deployment. It doesn't annoy
the users unless they add the parameter to the URL..

You can also write to the server (mod_python, fcgi) error log if you have
access to it.

regards,
j.

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to