Thomas
Thomas

Reputation: 2276

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?

Upvotes: 1

Views: 256

Answers (1)

Uku Loskit
Uku Loskit

Reputation: 42050

Try using this instead:

{{ request.user.get_profile.phone }}

Upvotes: 2

Related Questions