For a range of debugging options available for WSGI applications,
including how to get things like pdb to run in the context of Apache,
see:

  http://code.google.com/p/modwsgi/wiki/DebuggingTechniques

Graham

On Nov 10, 5:04 am, [EMAIL PROTECTED] wrote:
> On Fri, Nov 09, 2007 at 08:32:15AM -0700, John M. Anderson wrote:
> > > You cannot debug a single Django file in isolation. Instead, insert this
> > > line:
>
> > >    import pdb; pdb.set_trace()
>
> > > in sql.py, at the point you're interested in. Then run Django normally,
> > > and
> > > go to a db-based URL: you'll get a debugger prompt.
>
> > ok, thanks. I was just trying to debug without modifying files, it seems
> > silly
> > to have to modify the files to debug, but i'm new to python.
>
> If you are new to python: You don't need a debugger.
>
> Set up your servert, so that code gets reloaded automatically (either 
> 'manage.py
> runserver' or mod_python with 'MaxRequestsPerChild 1'). Then
> you can add 'assert False' or for example
> 'assert False, django.db.connection.queries' into the code you want
> to inspect. This will give you a lot of information if DEBUG=True is
> set in settings.py.
>
> Or: you can set up the logging module and add lines like
> logging.info("foo: %s" % (foo)) into the code.
>
> If you are new to python and django, you can ask on the user mailinglist
> first.
>
>  Thomas
>
> --
> Thomas Guettler,http://www.thomas-guettler.de/
> E-Mail: guettli (*) thomas-guettler + de


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To post to this group, send email to django-developers@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-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to