开发者

Django - Userprofile field in my template

I am using UserProfile in my django app. It works very well in my view. But I am having some difficult to show the values in my template.

Variable that I am trying to print in my template:

{{ request.user.get_profile().phone }}

Error:

Could not parse the remainder: '().phone'开发者_高级运维 from 'request.user.get_profile().phone '

Whats happened? How can I print mu userprofile variable?


Try using this instead:

{{ request.user.get_profile.phone }}
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜