That (or some variation) is the simplest way to do it, although you do not
need to attach the entire request object if you do not want to, i.e.:
return render_to_response('somepage.html',
{'username':request.user.username})
<p>{{ username }}</p>
On 6/24/08, Huuuze <[EMAIL PROTECTED]> wrote:
>
>
> A n00b question for everyone: My base template has a "Welcome
> <username>" section in it. Currently, I'm adding the username (which
> is coming from Django's auth/auth framework) to the template with the
> following bit of code:
>
> <p>{{ request.session.user.username }}</p>
>
> This works, however, it requires me to add the "request" object to any
> return statement that deals with displaying a page:
>
> return render_to_response('somepage.html', {'request':request})
>
> I'm guessing there's a better way to do this, but I can't seem to find
> an answer. Help!
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---