A custom 500 handler which is AJAX-aware

1
2
3
4
5
def my_500(request):
    if request.META.get('HTTP_X_REQUESTED_WITH') == 'XMLHttpRequest':
        return HttpResponse("")
    else:
        return render_to_response("500.html",{},context_instance=RequestContext(request))

More like this

  1. Use MEDIA_URL in 500 error page by bthomas 5 years, 5 months ago
  2. Extend simplejson to understand closures, functors, generators and iterators by ElfSternberg 4 years, 11 months ago
  3. Upload progress handler using cache framework by ebartels 6 years ago
  4. upload handler decorators by Rozza 5 years, 9 months ago
  5. Super User Conditional Page Exception Reporting by zbyte64 5 years, 8 months ago

Comments

buriy (on January 31, 2008):

how about to email error that was happened? ;)

#

(Forgotten your password?)