Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/20.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Django-我的模板中的Userprofile字段_Django_Django Templates - Fatal编程技术网

Django-我的模板中的Userprofile字段

Django-我的模板中的Userprofile字段,django,django-templates,Django,Django Templates,我正在django应用程序中使用UserProfile。在我看来,它运行得很好。但是我有一些困难来显示我的模板中的值 我试图在模板中打印的变量: {{request.user.get_profile().phone}} 错误: 无法分析“request.user.get_profile().phone”中的其余部分:“().phone” 发生了什么事?如何打印mu userprofile变量?请改用此选项: {{ request.user.get_profile.phone }}

我正在django应用程序中使用UserProfile。在我看来,它运行得很好。但是我有一些困难来显示我的模板中的值

我试图在模板中打印的变量:

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

错误:

无法分析“request.user.get_profile().phone”中的其余部分:“().phone”


发生了什么事?如何打印mu userprofile变量?

请改用此选项:

{{ request.user.get_profile.phone }}