On 11/23/2010 09:48 PM, Markus Barth wrote:
I am using quite a lot of asynchronous calls for updating a page. The
problem is that this way you never see a traceback. In turbogears the
development server prints all tracebacks to the terminal. Is there any
way to get a similar behaviour with django?

You'll have to enable that yourself with some middleware, strangely.

In your app/site, add a "middleware.py":


import logging

logger = logging.getLogger(__name__)


class TracebackLoggingMiddleware(object):
    """Middleware that logs exceptions.

    See http://djangosnippets.org/snippets/421/.

    To enable it, add
    'yourapp.middleware.TracebackLoggingMiddleware' to
    your setting.py's MIDDLEWARE_CLASSES.

    """

    def process_exception(self, request, exception):
        logger.exception(repr(request))



And do the MIDDLEWARE_CLASSES thingy in the docstring.



Reinout

--
Reinout van Rees - rein...@vanrees.org - http://reinout.vanrees.org
Collega's gezocht!
Django/python vacature in Utrecht: http://tinyurl.com/35v34f9

--
You received this message because you are subscribed to the Google Groups "Django 
users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to