Re: Best way to show/hide the logout link in a template?

2011-08-18 Thread Andre Lopes
Thanks Kev,

It was exactly what I needed.

Regards,


On Thu, Aug 18, 2011 at 10:45 PM, Kev Dwyer  wrote:
> Andre Lopes wrote:
>
>> Hi,
>>
>> I am new to Django... I have made a logout link, but now I am in doubt
>> on which the best way to show/hide this template tag:
>>
>> [code]
>> Logout
>> [/code]
>>
>> Which is the best way of show/hide this link?
>>
>> Sorry if it is a basic question.
>>
>>
>> Best Regards,
>>
>
> I use
>
> {% if user.is_authenticated %}
>
> to condition my logout link's appearance.
>
> See https://docs.djangoproject.com/en/1.3/topics/auth/#authentication-data-
> in-templates
>
> Cheers,
>
> Kev
>
> --
> 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.
>
>

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



Re: Best way to show/hide the logout link in a template?

2011-08-18 Thread Kev Dwyer
Andre Lopes wrote:

> Hi,
> 
> I am new to Django... I have made a logout link, but now I am in doubt
> on which the best way to show/hide this template tag:
> 
> [code]
> Logout
> [/code]
> 
> Which is the best way of show/hide this link?
> 
> Sorry if it is a basic question.
> 
> 
> Best Regards,
> 

I use

{% if user.is_authenticated %}

to condition my logout link's appearance.

See https://docs.djangoproject.com/en/1.3/topics/auth/#authentication-data-
in-templates

Cheers,

Kev

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



Best way to show/hide the logout link in a template?

2011-08-18 Thread Andre Lopes
Hi,

I am new to Django... I have made a logout link, but now I am in doubt
on which the best way to show/hide this template tag:

[code]
Logout
[/code]

Which is the best way of show/hide this link?

Sorry if it is a basic question.


Best Regards,

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