I\'m trying to write a view where the current logged in user\'s information is retrieved.
My view is written as below, and it works perfectly fine as long as I pass the
You don't really have to pass anything via url. You can directly access the logged in user from request.user. You can read about this over here. Also, you can check if the user is logged in using is_authentcated() method or using the login_required decorator
def ur_view(request):
#Check if the user is logged in
if not request.user.is_authenticated():
#your logic if user not logged in
else:
#If the user is logged in