1👍
✅
Make sure you pass the request context in the view, it’s what adds the user to the context…
from django.template import RequestContext
def some_view(request):
form = None
# request.user accesses user here
return render_to_response('some_template.html', {'form':form}, context_instance=RequestContext(request))
Now in the template you can use:
{% if request.user.is_authenticated %}{{ request.user.email }}{% endif %}
Source:stackexchange.com