阅读背景:

如何在Django 1.6中的多个应用程序中使用相同的auth userprofile

来源:互联网 

I'm using Django 1.6 auth module to login users and I have a project consisting of two apps and I want to use the same user by calling request.user.username in the view in my second app. That is, in my template login.html in the first app this works {% if user.is_authenticated %} but {% if user.is_authenticated %} does not work in the second apps templates and I'm wondering how I can fetch it in functions in the second app? I've tried to fetch it with user=request.user.username but it doesn't work. I'm using Django 1.6 auth module to login users




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: