How to use the Django Usurena “mugshot” template variable

前端 未结 4 1579
名媛妹妹
名媛妹妹 2021-01-21 21:44

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

4条回答
  •  醉话见心
    2021-01-21 22:31

    Here's the way it worked for me:

    {{ user.get_profile.get_mugshot_url }}

    But make sure you use render as opposed to render_to_response for each of the pages that you'll be pulling it in (ex: views.py):

    from django.shortcuts import render

    return render(request, 'sometemplate.html', {"name": "some_var"}, )

    Here's how I did it, pulling in the mugshot for the navbar dropdown (ex: sometemplate.html):

    
    

提交回复
热议问题