UserTestMixin in django code example
Example 1: django request user
def my_view(request):
if not request.user.is_authenticated:
return render(request, 'myapp/login_error.html')
Example 2: how to get the user argent in django
request.META['HTTP_USER_AGENT']