On 12/19/05, patrick kranzlmüller <[EMAIL PROTECTED]> wrote:
>
> i´m sorry if this is a trivial question, but i´m struggling with
> getting the username displayed on my app.
> user is already logged in, using django authentication (for my app is
> part of the admin-interface) - i just need to output the name.

In your template do something like:

{% if user.is_anonymous %}

<p>You are browsing as a guest.</p>

{% else %}

<p>You are browsing as {{ user.username }}.</p>

In views.py you need to do this:

from django.core.extensions import DjangoContext as Context

and then do this at the end of your functions:

context = Context( request )
return render_to_response( template, context )

Bryan

Reply via email to