request.user
Access the current user.
Example
def me(request):
if request.user.is_authenticated:
return HttpResponse(request.user.username)
return HttpResponse("guest")Exercise
Auth flag.
request.user.is_
Quiz Test
These free lessons are for learning. Join a full course for projects, mentor feedback and a verified certificate.