Huuuze 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!
Use the RequestContext:
http://www.djangoproject.com/documentation/templates_python/#subclassing-context-requestcontext
Regards,
--
Christian Joergensen
http://www.technobabble.dk
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---