Am 27.11.2005 um 14:53 schrieb Adrian Holovaty:
On 11/27/05, stava <[EMAIL PROTECTED]> wrote:
But what I'm really looking for is DEBUG capabilities when using
mod_python, i.e. I would like to be able to see my print statements
embedded in "if DEBUG:" and especially the db queries timings (which
are available somehow?). I do most of the debugging using the
django-admin runserver, but on occasion, it might be useful to do some
of it on a live site, if nothing else: when doing final verification
and testing before deployment. So, when using mod_python and turning on
DEBUG, where do the print statements end up?

When you use mod_python, print statements don't end up anywhere. The
best way to print out debugging statements is to either "assert False,
'hello world'" or add the debug output to the outputted page.

I've updated the mod_python docs page to reflect this.

Actually, AFAIK, you can do:

  print >> sys.stderr, "Hello"

to get messages into the Apache error log.
I.e. print to stderr instead of stdout.

Cheers,
Chris
--
Christopher Lenz
  cmlenz at gmx.de
  http://www.cmlenz.net/

Reply via email to