aboutsummaryrefslogtreecommitdiffstats
path: root/rest_framework/compat.py
diff options
context:
space:
mode:
authorswistakm2013-02-26 11:22:21 +0100
committerswistakm2013-02-26 11:22:21 +0100
commit59a6f5f463472656518cb0680b9da5f22a724882 (patch)
tree6f4b2c00a7004b30d5539c89e5788a44cec4746c /rest_framework/compat.py
parent5d9ed34e4115f683294082faf9c9584a53bb7e49 (diff)
downloaddjango-rest-framework-59a6f5f463472656518cb0680b9da5f22a724882.tar.bz2
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
Diffstat (limited to 'rest_framework/compat.py')
-rw-r--r--rest_framework/compat.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/rest_framework/compat.py b/rest_framework/compat.py
index 07fdddce..e4bad0cb 100644
--- a/rest_framework/compat.py
+++ b/rest_framework/compat.py
@@ -426,3 +426,15 @@ try:
import defusedxml.ElementTree as etree
except ImportError:
etree = None
+
+# OAuth is optional
+try:
+ import oauth2 as oauth
+except ImportError:
+ oauth = None
+
+# OAuth is optional
+try:
+ import oauth_provider
+except ImportError:
+ oauth_provider = None \ No newline at end of file