[Django]-Django: Catch/Log exceptions when using gevent-socketio and WSGIHandler

5👍

This fixed it

import sys
import traceback
from django.core.signals import got_request_exception

def exception_printer(sender, **kwargs):
    print >> sys.stderr, ''.join(traceback.format_exception(*sys.exc_info()))

got_request_exception.connect(exception_printer)

Leave a comment