Django has (usually great) behavior for turning exceptions into patterns into blank lines. So if I do {{object.fn_which_throws_exception}}, I just get an empty string. But sometimes I would like to know something about the exception: is there a way to make django real or register the data of such exceptions?
{{object.fn_which_throws_exception}}
If you use runserver, you can use pdb to execute the code.
runserver
Add import pdb; pdb.set_trace()over the problematic code. Go to the URL in question in your browser, and pdb should pause execution and let you go through the code line by line.
import pdb; pdb.set_trace()
http://docs.python.org/library/pdb.html
, , DEBUG TEMPLATE_DEBUG True.
DEBUG
TEMPLATE_DEBUG
True
, django-sentry . , DEBUG=True. , , .
DEBUG=True
EDIT: , . try... except :
try... except
def fn_which_throws_exception(): import sys try: # code that might raise exception except: return sys.exc_info()