Django has the (usually fine) behaviour of turning exceptions in templates into empty strings. 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 any way to make django present or log the details of such exceptions?
Django has the (usually fine) behaviour of turning exceptions in templates into empty strings.
Share
If you’re using
runserveryou could use pdb to step through the code.Add
import pdb; pdb.set_trace()above the problematic code. Go to the URL in question in your browser and pdb should pause the execution and let you step through the code line by line.http://docs.python.org/library/pdb.html