Answers for "django see pk of user admin"

0

get user ip address django

def visitor_ip_address(request):

    x_forwarded_for = request.META.get('HTTP_X_FORWARDED_FOR')

    if x_forwarded_for:
        ip = x_forwarded_for.split(',')[0]
    else:
        ip = request.META.get('REMOTE_ADDR')
    return ip
Posted by: Guest on December-01-2020
-2

how to get the user argent in django

request.META['HTTP_USER_AGENT']
Posted by: Guest on June-30-2020

Python Answers by Framework

Browse Popular Code Answers by Language