The other day, I read about another interesting way of debugging Django Apps:
If you use the following statement in you code:
import pdb; pdb.set_trace()
You can debug you app by running the server with the python command
manage.py runserver -p 8888
Then, after you visit the page where the set_trace() function is called, the server will break the code [...]
I was looking for something similar to print_r in PHP for Django. I haven’t really found something other than:
import pprint
pprint.pprint(dir(modelorobject))
and using:
{% debug %}
in your template, wich display all kinds of debug info.
If anyone has more info on debugging Django, or a print_r kind of way of outputting debug info, please use the comments.
In this context [...]