  from rest_framework.compat import CsrfViewMiddleware
  from rest_framework.authtoken.models import Token
  import base64
  
  from django.core.exceptions import ImproperlyConfigured
  try:
      import oauth2
  except ImportError:
      oauth2 = None
  
  try:
      import oauth_provider
      from oauth_provider.store import store
  except ImportError:
      oauth_provider = None
  
  
  class BaseAuthentication(object):
      """
      All authentication classes should extend BaseAuthentication.
      """
 
</s> remove         :returns: two-tuple of (user, auth) if authentication succeeds, or None otherwise.
 </s> add         Returns two-tuple of (user, auth token) if authentication succeeds, or None otherwise. </s> remove             except oauth2.Error, e:
                print "got e"
 </s> add             except oauth.Error, e: </s> remove     django-oath-plus"""
 </s> add     django-oath-plus and oauth2"""
  from rest_framework.compat import CsrfViewMiddleware
  from rest_framework.authtoken.models import Token
  import base64
  












  
  class BaseAuthentication(object):
      """
      All authentication classes should extend BaseAuthentication.
      """
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
 Move oauth2 and django-oauth-plus imports to compat and fix some minor issues

- alias oauth2 as oauth
- remove rouge print
- remove docstring markups
- OAuthAuthentication.authenticate() now returns (user, token) two-tuple on success
- don't set request.user because it's already set 
rest_framework/authentication.py