Closed Psycojoker closed 12 years ago
I'm also unsure whether this is the right way to go about it.
I understand that you'd want to debug a template on the fly, but it occurs to me that debugging just a variable isn't very useful. Perhaps we're aiming for something more generalized that lets you stop rendering halfway through a template?
Weill, I found that often useful, especially because I'm often carrying around complex objects in my templates (maybe not the best practice) and being able to understand why the hell one of them isn't working as expected save me plenty of time.
This said, you might be on a cool idea, I don't see for the moment how this could be done.
Ah. Now that you've explained it, the use-case is more obvious. Perhaps the documentation should show a more complex object being inspected? Like a QuerySet?
I suppose the |pdb
filter would also be useful in debugging other filters as well. Such as when you chain |pdb|custom_filter
so that you can step through to the next one?
Indeed for debuging a filter, didn't saw that usecase. I've updated the README in this regards and with informations on the possible usecase of this filter.
Usage:
Drop you in a ipdb with the variable if ipdb is installed otherwise in pdb.