def hcard_view(request, guid):
"""Generate a hcard document.
For local users only.
"""
try:
profile = get_object_or_404(Profile, guid=guid, user__isnull=False)
except ValueError:
raise Http404()
hcard = generate_hcard(
"diaspora",
hostname=settings.SOCIALHOME_URL,
fullname=profile.name,
firstname=profile.get_first_name(),
lastname=profile.get_last_name(),
photo300=profile.safer_image_url_large,
photo100=profile.safer_image_url_medium,
photo50=profile.safer_image_url_small,
searchable="true" if profile.public else "false",
guid=profile.guid,
username=profile.user.username,
public_key=profile.rsa_public_key,
)
return HttpResponse(hcard)
评论列表
文章目录