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 }}
精彩评论