David Larlet  committed b53fed5

Updating to the latest version of python-oauth2, modifications mainly related to

  • Participants
  • Parent commits 3e4c733

Comments (0)

Files changed (6)

File oauth_provider/

 from oauth2 import Error
-    from functools import wraps, update_wrapper
+    from functools import update_wrapper
 except ImportError:
-    from django.utils.functional import wraps, update_wrapper  # Python 2.3, 2.4 fallback.
+    from django.utils.functional import update_wrapper  # Python 2.3, 2.4 fallback.
-from django.contrib.auth import REDIRECT_FIELD_NAME
 from django.utils.translation import ugettext as _
 from utils import initialize_server_request, send_oauth_error, get_oauth_request

File oauth_provider/

 from django.db import models
-from django.contrib.auth.models import User
-from consts import KEY_SIZE, SECRET_SIZE
 class ConsumerManager(models.Manager):
     def create_consumer(self, name, user=None):

File oauth_provider/

 Django installation
-There are a few steps for setting up a proper installation. The `OAuth Python
-library`_ is required and must be patched (at least for the moment).
+First, install dependencies through pip::
-.. _`OAuth Python library`:
-You can find a custom version of the module at the root level of django-oauth.
+    pip install -r requirements.txt
 You need to specify the OAuth provider application in your settings and to 
 sync your database thanks to the ``syncdb`` command. Then add it to your 

File oauth_provider/

 from django.conf import settings
 from django.http import HttpResponse, HttpResponseBadRequest
-from consts import MAX_URL_LENGTH, OUT_OF_BAND
+from consts import MAX_URL_LENGTH
 OAUTH_REALM_KEY_NAME = getattr(settings, 'OAUTH_REALM_KEY_NAME', '')
 OAUTH_SIGNATURE_METHODS = getattr(settings, 'OAUTH_SIGNATURE_METHODS', ['plaintext', 'hmac-sha1'])
         parameters = dict(request.REQUEST.items())
     oauth_request = oauth.Request.from_request(request.method, 
-                                              request.build_absolute_uri(), 
+                                              request.build_absolute_uri(request.path), 
                                               query_string=request.META.get('QUERY_STRING', ''))

File requirements.txt

--e git://
 from setuptools import setup, find_packages
-    name='django-oauth',
-    version='1.1',
-    description='Support of OAuth in Django.',
+    name='django-oauth-plus',
+    version='2.0',
+    description='Support of OAuth 1.0a in Django using python-oauth2.',
     author='David Larlet',
-    url='',
+    url='',
-        'Development Status :: 5 - Production/Stable',
+        'Development Status :: 4 - Beta',
         'Environment :: Web Environment',
         'Intended Audience :: Developers',
         'License :: OSI Approved :: BSD License',