I am using djangoappengine. When I try create a new user, authenticate that user, and log them in, I get the following error AttributeError: 'AnonymousUser' object has no attribute 'backend' . My code is simple and looks like: user = User.objects.create_user(username, username, password) user.set_password(password) user.save() user = django.contrib.auth.authenticate(username=username, password=password) django.contrib.auth.login(request, user) I only get the following error on production and only occasionally: web req_create: 'AnonymousUser' object has no attribute 'backend' Traceback (most