When you render_to_template you pass dictionary of different items the template need to render things. Some of them are used commonly across all pages, for example, a user greeting or something similar to that. Is there a way to make live little easier by somehow passing this kind of dictionary items into all templates without having to explicitly define them in each view?
When you render_to_template you pass dictionary of different items the template need to render
Share
This is what context processors are for — you can define a dictionary that gets added to the context of every response.
They’re very simple to write, and you just need to add them to your settings. Just remember to make sure that you are using RequestContext rather than a plain Context for your templates, and they’ll run automatically, every time.
Docs are here: https://docs.djangoproject.com/en/1.3/ref/templates/api/#writing-your-own-context-processors