Created
June 18, 2010 20:21
-
-
Save akrito/444174 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
try: | |
from ipdb import Pdb | |
except ImportError: | |
from pdb import Pdb | |
import sys | |
class PdbTraceback(object): | |
""" | |
Drops into pdb or ipdb if a view raises an exception. Should be the last | |
thing in MIDDLEWARE_CLASSES | |
""" | |
def process_exception(self, request, exception): | |
Pdb().interaction(None, sys.exc_info()[2]) | |
return None |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment