Commits

Alexis Metaireau committed ad2aaec

Add a way to configure the consumer tokens size via settings.py

Comments (0)

Files changed (4)

TODO

-Write documentation
-Write view tests
+django-oautclient
+=================
+
+* Write view tests

oauthclient/models.py

 from django.db import models
+from django.conf import settings
+from oauthclient.settings import OAUTH_CONSUMER_KEY_SIZE, OAUTH_CONSUMER_SECRET_SIZE
 import oauth2
 
-KEY_SIZE = SECRET_SIZE = 16
+KEY_SIZE = getattr(settings, 'OAUTH_CONSUMER_KEY_SIZE', 
+    OAUTH_CONSUMER_KEY_SIZE)
+SECRET_SIZE = getattr(settings,'OAUTH_CONSUMER_SECRET_SIZE', 
+    OAUTH_CONSUMER_SECRET_SIZE) 
 
 class OAuthServer(models.Model):
     """Defines the urls to use for the oauth authentication.

oauthclient/settings.py

+OAUTH_CONSUMER_KEY_SIZE = 18 
+OAUTH_CONSUMER_SECRET_SIZE = 32