title: AttributeError: ​module 'django.http.request' has no attribute 'user // i have Django rest installed
body: <p><strong>Error I am getting</strong></p>
  <blockquote>
  <p>AttributeError: module 'django.http.request' has no attribute 'user'</p>
  </blockquote>
  <p><strong>Signal I am trying to send when user logs in</strong></p>
  <pre><code>def auth_done(sender, **kwargs):
      print('User has logged in')
      tok = Token.objects.create(user=request.user)
      print(tok.key())
  
  
  user_logged_in.connect(auth_done, sender=User)
  </code></pre>
  <p><strong>Login view</strong></p>
  <pre><code>@csrf_exempt
  def login_in(request):
      if request.method == 'POST':
          name = request.POST['first_name']
          password = request.POST['password']
  
          user = authenticate(username=name, password=password)
          if user is not None:
              print(user)
              login(request, user)
              tok = Token.objects.create(user=request.user)
              print(tok.key)
              print('User is authenticated')
          else:
              print('Not authenticated')
      return render(request, 'Auth/user.html')
  </code></pre>
  <p><strong>Settings</strong></p>
  <pre><code>REST_FRAMEWORK = {
      'DEFAULT_AUTHENTICATION_CLASSES': [
          'rest_framework.authentication.BasicAuthentication',
          'rest_framework.authentication.SessionAuthentication',
      ],
  # Use Django's standard `django.contrib.auth` permissions,
  
      'DEFAULT_PERMISSION_CLASSES': [
          'rest_framework.permissions.isAuthenticated'
      ]
  }
  </code></pre>