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