title: unable to log in using curl and django JWT even though credentials correct
body: <p>I have a custom user model in django here: </p>
  
  <pre><code>class UserManager(BaseUserManager):
      def create_User(self, email, name, companyname=None, userphoto=None,
                      userphotokey=None, signupvalidatestring=None, is_active=False, phone=None, jobtitle=None,
                      isclient=False, issuitsviewer=False, issuitsadministrator=False, issuitssuperuser=False,
                      password=None):
          if not email:
              raise ValueError('Users must have an email address')
          if not name:
              raise ValueError('Users must have a name')
          user = self.model(email = self.normalize_email(email),
                            name = name,
                            companyname= companyname,
                            userphoto= userphoto,
                            userphotokey=userphotokey,
                            signupvaildatestring=signupvalidatestring,
                            is_active=is_active,
                            phone=phone,
                            jobtitle=jobtitle,
                            isclient=isclient,
                            issuitsviewer = issuitsviewer,
                            issuitsadministrator=issuitsadministrator,
                            isuitssuperuser=issuitssuperuser)
          if not password:
              user.set_unusable_password()
          else:
              user.set_password(password)
              user.is_active = True
              user.save(using=self._db)
              return user
  
      def create_superuser(self):
          pass
  
  # permissions table
  
  
  
  class STUser(AbstractBaseUser):
      email = models.EmailField(unique=True)
      name = models.CharField(max_length=255)
      companyname = models.CharField(max_length=200, blank=True, null=True)
      userphoto = models.CharField(max_length=200, blank=True, null=True)
      userphotokey = models.CharField(max_length=200, blank=True, null=True)
      signupvaildatestring = models.CharField(max_length=200, blank=True, null=True)
      is_active = models.BooleanField(default=False)
      phone = models.CharField(max_length=10, null=True, blank=True)
      jobtitle = models.CharField(max_length=100, null=True, blank=True)
      isclient = models.BooleanField(default=False)
      issuitsviewer = models.BooleanField(default=False)
      issuitsadministrator = models.BooleanField(default=False)
      issuitssuperuser = models.BooleanField(default=False)
      # password field function is provided by AbstractBaseUser
  
      objects = UserManager()
  
      USERNAME_FIELD = 'email'
      REQUIRED_FIELDS = ['name']
      EMAIL_FIELD = 'email'
  
  class VenuePermissions(models.Model):
      user = models.ForeignKey(STUser, on_delete=models.CASCADE)
      venue = models.ForeignKey(Venue, on_delete=models.CASCADE, blank=True, null=True)
      isvenueviewer = models.BooleanField(default=False)
      isvenueeventplanner = models.BooleanField(default=False)
      isvenueadministrator = models.BooleanField(default=False)
      receiverfp = models.BooleanField(default=False)
  </code></pre>
  
  <p>I have the jwt auth class up: </p>
  
  <pre><code>#REST Framework
  REST_FRAMEWORK = {
      'DEFAULT_PERMISSION_CLASSES': (
          'rest_framework.permissions.IsAuthenticated',
      ),
      'DEFAULT_AUTHENTICATION_CLASSES': (
          'rest_framework_jwt.authentication.JSONWebTokenAuthentication',
  </code></pre>
  
  <p>I have the url endpoint: </p>
  
  <pre><code>from rest_framework_jwt.views import obtain_jwt_token
  url(r'^api-token-auth/', obtain_jwt_token),
  </code></pre>
  
  <p>when I create a user in the shell like this: </p>
  
  <pre><code>&gt;&gt;&gt; from STuser.models import STUser
  &gt;&gt;&gt; user = STUser(email='blah@gmail.com',name='Christopher Jakob',password='zaq11qaz')
  &gt;&gt;&gt; user.save()
  </code></pre>
  
  <p>then run a curl post: </p>
  
  <pre><code>curl -X POST -d "email=blah@gmail.com&amp;password=zaq11qaz" http://127.0.0.1:8000/api-token-auth/
  </code></pre>
  
  <p>and also tried the JSON implementation </p>
  
  <pre><code>curl -X POST -H "Content-Type: application/json" -d '{"email":"blah@gmail.com","password":"zaq11qaz"}' http://127.0.0.1:8000/api-token-auth/
  </code></pre>
  
  <p>I also tried with wget:</p>
  
  <p><code>wget --post-data="email=christopher.m.jakob@gmail.com&amp;password=zaq11qaz" http://127.0.0.1:8000/api-token-auth</code>/</p>
  
  <p>I get the following error: </p>
  
  <pre><code>{"non_field_errors":["Unable to log in with provided credentials."]}
  "POST /api-token-auth/ HTTP/1.1" 400 68
  </code></pre>
  
  <p>However the <code>email</code> and the <code>password</code> info I have submitted is what is in the database. </p>
  
  <p>I am not sure what is going on here. I am wondering if it is in my manager? But I would imagine if such where the case the user objects wouldn't get added at all. As you can see I am using a custom user model.</p>
  
  <p>here is the resource I am using:</p>
  
  <p><a href="https://getblimp.github.io/django-rest-framework-jwt/" rel="nofollow noreferrer">https://getblimp.github.io/django-rest-framework-jwt/</a> </p>
  
  <p>question that might help me looking into it: 
  <a href="https://stackoverflow.com/questions/42429477/django-using-tokenauthentication-non-field-errors-unable-to-log-in-with-p?rq=1">Django (using TokenAuthentication): &quot;non_field_errors&quot;: &quot;Unable to log in with provided credentials?</a></p>
  
  <p>this question may also provide help: looking into it.
  <a href="https://stackoverflow.com/questions/33468634/json-web-token-for-django-rest-wont-authenticate-to-user-database">JSON Web Token for Django REST won&#39;t authenticate to user database</a></p>
  
  <p>The relevant code in the package I am using starts on line 22 
  <a href="https://github.com/GetBlimp/django-rest-framework-jwt/blob/master/rest_framework_jwt/serializers.py" rel="nofollow noreferrer">https://github.com/GetBlimp/django-rest-framework-jwt/blob/master/rest_framework_jwt/serializers.py</a></p>