Commits

bdb  committed 97ce3e2

Allow settings to override default lengths.

  • Participants
  • Parent commits aa3ed68

Comments (0)

Files changed (1)

File oauth_provider/consts.py

 from django.utils.translation import ugettext_lazy as _
+from django.conf import settings
 
-KEY_SIZE = 16
-SECRET_SIZE = 16
-VERIFIER_SIZE = 10
-CONSUMER_KEY_SIZE = 256
+KEY_SIZE = getattr(settings, 'OAUTH_PROVIDER_KEY_SIZE', 16)
+SECRET_SIZE = getattr(settings, 'OAUTH_PROVIDER_SECRET_SIZE', 16)
+VERIFIER_SIZE = getattr(settings, 'OAUTH_PROVIDER_VERIFIER_SIZE', 10)
+CONSUMER_KEY_SIZE = getattr(settings, 'OAUTH_PROVIDER_CONSUMER_KEY_SIZE', 256)
 MAX_URL_LENGTH = 2083 # http://www.boutell.com/newfaq/misc/urllength.html
 
 PENDING = 1