作者sean72 (.)
看板Web_Design
标题Fw: [问题] django view and templates
时间Tue Mar 15 07:10:57 2016
※ [本文转录自 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传出来的
谢谢大家解答
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 204.96.168.3
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/Python/M.1457997041.A.BE8.html
※ 发信站: 批踢踢实业坊(ptt.cc)
※ 转录者: sean72 (204.96.168.3), 03/15/2016 07:10:57
1F:推 mraaa: 一样是内建就帮你传下去罗! 03/15 12:43
2F:推 abz53378: request.user 03/17 12:11