Last active
December 11, 2015 04:29
-
-
Save highcat/4545876 to your computer and use it in GitHub Desktop.
Django - print traceback to console in debug mode
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if settings.DEBUG: | |
from django.core.signals import got_request_exception | |
import traceback | |
def _print_request_error(sender, request, **kwargs): | |
traceback.print_exc() | |
got_request_exception.connect(_print_request_error) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment