How can i query User model to get user informations like: username, email, first name, and last name into his profile. I want to display all these information in his profile page.
as you can see here in the Profle view i'm willing to access user email, but how can i query the database to get all these information in the profile page ?
def profile(request, pk):
user_profile = User.objects.filter(email=request.user)
context = {'user_profile':user_profile}
return render(request, 'profile.html', context)
the profile template:
<p>{{user.email}}</p>