title: drf django rest auth how to expire or delete token?
body: <p>I am trying to implement authentication using <code>django-rest-framework</code> and <code>django-rest-auth</code> by tivix (<a href="http://django-rest-auth.readthedocs.io/en/latest/api_endpoints.html" rel="noreferrer">link to documentation</a>). I created a user using django shell like:</p>
  
  <pre><code>from django.contrib.auth.models import User
  user = User.objects.create_user(username='foo', email='foo@bar.com', password='bar')
  user.save()
  </code></pre>
  
  <p>Then According to <a href="http://django-rest-auth.readthedocs.io/en/latest/api_endpoints.html" rel="noreferrer">Documentation</a> I logged in a user using <code>django-rest-auth</code> like (Terminal Command):</p>
  
  <pre><code>curl -X POST -d "username=foo&amp;password=bar&amp;email=foo@bar.com" http://127.0.0.1:8000/rest-auth/login/
  </code></pre>
  
  <p>and it returned a token and I know the user is authenticated.</p>
  
  <p>Now I signed out using method described in documentation of django-rest-auth and I can still see the token present in the database. Then I logged in again and it returned the same token as key.</p>
  
  <p>So is there any way by which the token changes or better is deleted every time the user logs out. Also there is no mention in documentation if the token itself will expire(delete automatically) after certain time has passed.</p>
  
  <p>If no such thing is possible, how can I delete the token in both cases?</p>
  
  <p>EDIT : LOGIN &amp; LOGOUT CODE</p>
  
  <p>urls.py (main):</p>
  
  <pre><code>url(r'^rest-auth/', include('rest_auth.urls')),
  </code></pre>
  
  <p>settings.py: </p>
  
  <pre><code>INSTALLED_APPS = [
      ...
      'rest_framework',
      'rest_framework.authtoken',
      'rest_auth',
      ...
  ]
  </code></pre>
  
  <p>Login CURL Command: (GIVEN ABOVE).
  Login Command Response:</p>
  
  <pre><code>{u'key': u'e41f0a1c2f5e55569df1c41d1d5d4efb77beddee'}
  </code></pre>
  
  <p>Logout CURL Command: </p>
  
  <pre><code>curl -X POST -d "key=e41f0a1c2f5e55569df1c41d1d5d4efb77beddee" http://127.0.0.1:8000/rest-auth/logout/
  </code></pre>
  
  <p>Logout Response:</p>
  
  <pre><code>{u'success': u'Successfully logged out.'}
  </code></pre>