django usermode;l code example
Example 1: how to get user id django
def sample_view(request):
current_user = request.user
print current_user.id
Example 2: how to get the user argent in django
request.META['HTTP_USER_AGENT']
def sample_view(request):
current_user = request.user
print current_user.id
request.META['HTTP_USER_AGENT']