Have var available in every context passed to a template?

0 views
Skip to first unread message

apramanik

unread,
Nov 21, 2009, 9:48:46 PM11/21/09
to Django users
Hi all,

Is there a way (either via decorators or some other mechanism) to get
an var/object (say request.user) to be in the context passed to every
template. The reason I want to do this is my base template uses
"user.is_authenticated" in a branch. Thanks

Abhik

Christophe Pettus

unread,
Nov 21, 2009, 9:52:24 PM11/21/09
to django...@googlegroups.com

apramanik

unread,
Nov 22, 2009, 11:03:17 AM11/22/09
to Django users
Great, that worked!

Abhik

On Nov 21, 6:52 pm, Christophe Pettus <x...@thebuild.com> wrote:
> On Nov 21, 2009, at 6:48 PM, apramanik wrote:
>
> > Is there a way (either via decorators or some other mechanism) to get
> > an var/object (say request.user) to be in the context passed to every
> > template. The reason I want to do this is my base template uses
> > "user.is_authenticated" in a branch. Thanks
>
>        http://docs.djangoproject.com/en/dev/ref/templates/api/#django-core-c...
Reply all
Reply to author
Forward
0 new messages