chameleon: How to check whether user is logged in or not

17 views
Skip to first unread message

Kesav Kumar Kolla

unread,
Jan 31, 2012, 2:22:41 AM1/31/12
to pylons-...@googlegroups.com
I want to conditionally include some links in my chameleon template.  How to write condition in chameleon to check whether user is logged in?

Thanks in advance
-kesav

cd34

unread,
Feb 1, 2012, 2:58:57 PM2/1/12
to pylons-discuss
On Jan 31, 2:22 am, Kesav Kumar Kolla <kesavko...@gmail.com> wrote:
> I want to conditionally include some links in my chameleon template.  How
> to write condition in chameleon to check whether user is logged in?

Making A “User Object” Available as a Request Attribute (first
paragraph)
http://docs.pylonsproject.org/projects/pyramid_cookbook/en/latest/authentication.html

allows you to make the User object part of the request object, at
which point you can access the user object in your templates as
request.user.username (if username is a valid field in your user
object).
Reply all
Reply to author
Forward
0 new messages