406 (Not Acceptable) when POSTing from Ember to DRF API
<p>I'm using <code>ember-simple-auth</code> and <code>ember-simple-auth-token</code> for allowing users to log into my app. However, when I call Django Rest Framework in the backend with a POST request to authenticate using a username and password, I get a 406 (Not Acceptable) error. This does not happen in the DRF browsable API, so the backend seems to work fine.</p>

<p>I suspect something related to CORS. I use <code>django-cors-headers</code> in Django, and allow all in my dev environment. I also use <code>django-rest-framework-jwt</code> and <code>django-rest-framework-json-api</code> packages, if that matters.</p>

<p>My API shows an OPTIONS and then a POST call being made:</p>

<pre><code>[09/Mar/2016 07:15:54] "OPTIONS /api-token-auth/ HTTP/1.1" 200 0
[09/Mar/2016 07:15:54] "POST /api-token-auth/ HTTP/1.1" 406 114
</code></pre>

<p>Response headers:</p>

<pre><code>HTTP/1.0 406 Not Acceptable
Date: Wed, 09 Mar 2016 07:15:54 GMT
Server: WSGIServer/0.2 CPython/3.5.1
X-Frame-Options: SAMEORIGIN
Access-Control-Allow-Origin: *
Content-Type: application/vnd.api+json
Allow: POST, OPTIONS
Vary: Accept
</code></pre>

<p>Request headers:</p>

<pre><code>POST /api-token-auth/ HTTP/1.1
Host: localhost:8000
Connection: keep-alive
Content-Length: 2
Accept: application/json, text/javascript
Origin: http://localhost:4200
User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/48.0.2564.116 Chrome/48.0.2564.116 Safari/537.36
Content-Type: application/json
Referer: http://localhost:4200/login
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.8
</code></pre>

<p>The request headers do not show <code>application/vnd.api+json</code> but <code>application/json</code> instead. Unfortunately, no matter what I do in Ember is able to resolve that. I've unsuccessfully tried setting the headers to <code>"Accept": "application/vnd.api+json"</code> for my app's JSONAPIAdapter, and in <code>ENV['ember-simple-auth-token']</code>.</p>