Skip to content

Instantly share code, notes, and snippets.

@highcat
Last active December 11, 2015 04:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save highcat/4545876 to your computer and use it in GitHub Desktop.
Save highcat/4545876 to your computer and use it in GitHub Desktop.
Django - print traceback to console in debug mode
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