Fw: [问题] django view and templates

楼主: sean72 (.)   2016-03-15 07:10:57
※ [本文转录自 Python 看板 #1MvqJnle ]
作者: sean72 (.) 看板: Python
标题: [问题] django view and templates
时间: Tue Mar 15 07:10:35 2016
tutorial
https://thinkster.io/django-angularjs-tutorial
github
https://github.com/brwr/thinkster-django-angular
在templates/navbar.html里面
他用变量user.is_authenticated 来切换navbar按钮
请问在authentication/view.py 里面
他是如何产生变量 user 并且放在context然后return response?
我隐约觉得这跟django built-in authentication User Class有关联
但是却不清楚template里面的user是怎么从view.py传出来的
谢谢大家解答
作者: mraaa (重新出发....)   2016-03-15 12:43:00
一样是内建就帮你传下去囉!
作者: abz53378 (vu. )   2016-03-17 12:11:00
request.user

Links booklink

Contact Us: admin [ a t ] ucptt.com