Commits

David Larlet  committed b53fed5

Updating to the latest version of python-oauth2, modifications mainly related to https://github.com/simplegeo/python-oauth2/commit/c9ce81bfb436c06d8048a16be445b6678ebef151

  • Participants
  • Parent commits 3e4c733

Comments (0)

Files changed (6)

File oauth_provider/decorators.py

 from oauth2 import Error
 
 try:
-    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/managers.py

 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/tests.py

 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`: http://oauth.googlecode.com/svn/code/python/oauth/
-
-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/utils.py

 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), 
                                               headers=auth_header,
                                               parameters=parameters,
                                               query_string=request.META.get('QUERY_STRING', ''))

File requirements.txt

-Django==1.2.1
-httplib2==0.6.0
--e git://github.com/simplegeo/python-oauth2@1f9640f8467a90fcc20be6bbb8909d21bad308f6#egg=oauth2-1.2.1-py2.6-dev
+Django==1.2.4
+oauth2==1.5.170
 wsgiref==0.1.2
 from setuptools import setup, find_packages
  
 setup(
-    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',
     author_email='david@larlet.fr',
-    url='http://code.welldev.org/django-oauth/',
+    url='http://code.welldev.org/django-oauth-plus/',
     packages=find_packages(),
     classifiers=[
-        'Development Status :: 5 - Production/Stable',
+        'Development Status :: 4 - Beta',
         'Environment :: Web Environment',
         'Intended Audience :: Developers',
         'License :: OSI Approved :: BSD License',