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
Use the following code to display Userena profile image(mugshot) in your template. Use appropriate username to filter the required user.
views.py
from django.shortcuts import get_object_or_404
from django.contrib.auth.models import User
def my_view(request):
profile = get_object_or_404(User, username__iexact=username).get_profile()
return render_to_response('template.html', locals(), context_instance=RequestContext(request))
Here I have rendered this variable "profile" to the template "template.html". Include following code in your template to display mugshot image.
template.html
It worked for me. Hope it will work for you too. Thanks.