On 12 Feb, 18:38, Merric Mercer <[EMAIL PROTECTED]> wrote:
> By using TEMPLATE_ CONTEXT_PROCESSOR (by adding a path to a function,
> example -  Function X) I understand that I can access the variables of
> Function X in any template.

In any template to which you pass a RequestContext object.

> What I would like to know is does this function get run in every
> template - even if I don't need it in a template.

Yes, even when using the admin (because it uses RequestContext).

> For example,  Let's presume I need variables from Function X in 10 out
> of 15 templates. By adding the path to Function X in
> TEMPLATE_CONTEXT_PROCESSOR,  do I suffer the overhead of Function X in
> the 5 templates which  do not need it.

You can return a simple dictionary for the functions which do not need
context processors. Just put inside it JUST the things you
specifically need in the single template.

Hope this helps.

Cristiano


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to