如何使用Django Usurena“mugshot”模板变量 [英] How to use the Django Usurena "mugshot" template variable
本文介绍了如何使用Django Usurena“mugshot”模板变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我试图在我们的Django网站中使用Userena,但我似乎无法弄清楚如何使用模板标签来显示mugshot。我尝试了以下内容来吐出图片标签中的网址:
I'm trying to use Userena in our Django website, but I can't seem to figure out how to use the template tag to display the mugshot. I have tried the following to spit out the URL within an image tag:
<img src="{{ owner_profile.get_mugshot_url }}">
和
<img src="{{ profile.get_mugshot_url }}">
任何人都有一些洞察力
谢谢!
推荐答案
根据alican答案,只需将以下代码放在模板中:
based on alican answer, just put following code in your template:
<img src="{{ user.get_profile.get_mugshot_url }}" />
这篇关于如何使用Django Usurena“mugshot”模板变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文