title: JSON Web Token for Django REST won't authenticate to user database
body: <p>I have a working Django REST API backend. I was previously using session authentication, but would like to move to token based for scaling across multiple servers. I have been researching this for a couple days now and I have not found an answer to my problem. I added the djangorestframework-jwt package to my application but when I try to authenticate is always returns:</p>
  
  <pre><code>{"non_field_errors":["Unable to login with provided credentials."]}
  </code></pre>
  
  <p>I see in the jwt package where this error is, and can follow the code back through the authentication process. I do not see any errors in the auth process. When I try to create a user with those credentials it says that a user already exists, so I know it is hitting the correct user table. I am not sure why the obtain_jwt_token endpoint will not authenticate my credentials. Below are relevant sections of my django app. Any help would be greatly appreciated. If I am leaving anything out that could help figure this out please let me know and I will upload it. Thanks,</p>
  
  <h1>app/settings.py</h1>
  
  <pre><code>REST_FRAMEWORK = {
  'DEFAULT_PERMISSION_CLASSES': (
      'rest_framework.permissions.IsAuthenticated',
      ),
  'DEFAULT_AUTHENTICATION_CLASSES': (
      'rest_framework_jwt.authentication.JSONWebTokenAuthentication',
      ),
  'DEFAULT_PAGINATION_CLASS': 'rest_framework.pagination.LimitOffsetPagination',
  'PAGE_SIZE': 100,}
  </code></pre>
  
  <h1>app/urls.py</h1>
  
  <pre><code>urlpatterns = patterns('',
  # Api
  url(r'^api/', include(router.urls)),
  url(r'^api/stats', statsviews.StatsView.as_view()),
  url(r'^api/testing', statsviews.TestView.as_view()),
  url(r'^api/login', 'rest_framework_jwt.views.obtain_jwt_token'),
  url(r'^api/logout', logout, {'next_page': '/api/login'}),
  url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework')),
  )
  </code></pre>
  
  <h1>curl command</h1>
  
  <pre><code>curl -d "email=test@myemail.com&amp;password=test123" http://webhost.mywebsite.com:8080/api/login/
  </code></pre>