class ExceptionLoggingMiddleware(object):

    def process_exception(self, request, exception):
        import traceback
print(traceback.format_exc())
Print a stack trace to stdout on errors in Django while using manage.py runserver