On your views.py, do something like:

@login_required

def readme(request):

    return render_to_response('acpypi/readme.html', {'user': request.user})

I mean, your view has to pass the 'user' value to the template. I use this
very same scheme where all my pages extent base.html, so in my readme.html:


{% extends "base.html" %}
...

I hope it helps.

Cheers,
Alan

On Wed, Jan 14, 2009 at 07:15, izzy_dizzy <zanu...@gmail.com> wrote:

>
> Hi all,
>
> I'm having a hard time on how to use request.user objects in
> base.html. I know that we can use requestcontext to be able to render
> request.user and its objects on a given template but I would like
> someone help me to be able to use it on base.html like:
>
> {% if user.is_authenticated%} You are currently logged in.{%endif%}
>
> I also tried to use custom template tags but I can't get it right. Can
> any one provide me a working custom template tag for this one?
>
> Thanks!!
>
> >
>


-- 
Alan Wilter S. da Silva, D.Sc. - CCPN Research Associate
Department of Biochemistry, University of Cambridge.
80 Tennis Court Road, Cambridge CB2 1GA, UK.
>>http://www.bio.cam.ac.uk/~awd28<<

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to