title: How do I create a login API using Django Rest Framework?
body: <p>I want to create a login api (or use an existing one if it is already pre-bundled) using django rest framework.  However, I'm completely at a loss.  Whenever I send a post request to the django rest framework "login" url, it just sends back the browsable api template page...</p>
  
  <p><strong>MY CONFIGURATION</strong></p>
  
  <p>urls.py</p>
  
  <pre><code>url(r'^api/v1/', include('rest_framework.urls', namespace='rest_framework'))
  </code></pre>
  
  <p>settings.py</p>
  
  <pre><code>REST_FRAMEWORK = {
      'DEFAULT_AUTHENTICATION_CLASSES': (
          'rest_framework.authentication.BasicAuthentication',
          'rest_framework.authentication.SessionAuthentication',
      )
  }
  </code></pre>
  
  <p><strong>WHAT I WANT</strong> </p>
  
  <p>Request: </p>
  
  <pre><code>POST /api/v1/login  username='name' pass='pass'
  </code></pre>
  
  <p>Response: </p>
  
  <pre><code>200 OK "{username: 'name', 'userId': '54321'}" set-cookie: sessionid="blahblah"
  </code></pre>