On Jan 5, 12:38 pm, Rainy <andrei....@gmail.com> wrote: > On Jan 5, 12:35 pm, Guy Nesher <nesher....@gmail.com> wrote: > > > Thanks, > > > I've initially tried to use a dictionary but was still unable to pull > > the data in the template. > > > I'm using your updated context processor: > > def swiss_context_processors(request): > > added_context = { 'mytest': 'aaa', } > > return added_context > > > and trying to call {{added_context.mytest}} in the template which > > returns nothing > > It should be just {{ mytest }}
I should add that in Python, it doesn't matter what is the variable name of value being returned. So if you have def x(): a=1; return a def y(): b=x() There is no way for y() to know that inside x(), the variable was called 'a'. It receives the value only. It's effectively equivalent to x() being: def x(): return 1 So you need to understand that django template processing receives the dictionary {'mytest':'aaa'} and could not possibly know what you mean by 'added_context'. -ak -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.