Posted on Fri 27 Jan 2012 under Web Development
While searching and experimenting for ways to pass context variables to templates in Django, I found a way that avoids the longer route of passing a custom context function through TEMPLATE_CONTEXT_PROCESSORS in the settings file and using RequestContext in every view function. The approach involves creating a single function that returns a context dictionary and just using this to update every view function where the custom context is needed.