Hi,

add a middleware class and write a 

def process_exception(self, request, exception):

function where you send the mail yourself.
look at http://bitbucket.org/ashcrow/django-error-capture-middleware to get an 
idea,
of how to preceed errors yourself...

regards

Hinnack

>reply to message:
>date: 17.09.2010 09:30:00
>from: "Chase" <chase.seib...@gmail.com>
>to: "Django users" <django-users@googlegroups.com>
>subject: Adding username to the 500 error emails
>
>I'm looking to add request.user.username to the content of the 500
>error email that gets sent to settings.ADMINS. Of course, this assumes
>that you're using the AuthenticationMiddleware.
>
>I've tried the following:
>
> - Adding username to request.COOKIES via response.set_cookie(). This
>works, but if you have several authentication mechanisms, you end up
>repeating this code in various places.
>
> - Over-riding WSGIRequest.__repr__? No idea how this could be done.
>
> - Over-riding handle_uncaught_exception() in BaseHandler. Not sure
>how this could be done, either.
>
>Ideas?
>
>-- 
>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.
>

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