Say, I find some bug in a web interface. I open firebug and discover element and class, id of this element. By them I can then identify a template which contains variables, tags and so on.
How can I move forward and reveal in which .py files these variables are filled in?
I know how it works in Lift framework: when you’ve found a template there are elements with attributes bound to snippets. So you can easily proceed to specific snippets and edit code.
How does it work in django? May be, I suppose wrong process… then point me to the right algorithm, please.
Determining template variable resolution is all about
Context.viewbeing invoked.settings.pyfor the list ofTEMPLATE_CONTEXT_PROCESSORS. These are routines that are called automatically and invisibly to add values to the Context being passed to the template. This is sort of a Man Behind the Curtain™ process that can really trip you up if you don’t know about it.{%expr%}that can do evaluation in the template, but I always use it as close to the point of need as possible to highlight the fact it is being used.Note that because of the way Django template variables are resolved,
{{foo.something}}could be either a value or a callable method. I have serious issues with this syntax, but that’s the way they wrote it.