how to get the variable in the context

8 views
Skip to first unread message

DanYun Liu

unread,
Apr 28, 2012, 5:11:34 AM4/28/12
to django...@googlegroups.com
I defined a context processor to pass the login user info to the template. and, I also need to use it in the view.

is there any way to get the variable from the context?

--
Pursuit the freedom of the soul.

Amao Zhao

unread,
Apr 28, 2012, 5:29:45 AM4/28/12
to django...@googlegroups.com
Dear DanYun Liu
    Django has the biuld-in middlewar with the user.
    You can use the user in your templates immediately.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To post to this group, send email to django...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

Thomas Rega

unread,
Apr 28, 2012, 6:53:47 AM4/28/12
to liud...@gmail.com, django...@googlegroups.com
Am 28.04.12 11:11, schrieb DanYun Liu:
> I defined a context processor to pass the login user info to the
> template. and, I also need to use it in the view.
>
> is there any way to get the variable from the context?
>

http://stackoverflow.com/questions/41547/always-including-the-user-in-the-django-template-context

good luck,

TR


--


http://www.pyt3ch.com


Reply all
Reply to author
Forward
0 new messages