From 855ba981c0338cd017e71c52e8d50410fb07e8a4 Mon Sep 17 00:00:00 2001 From: guoqiao Date: Tue, 3 Mar 2015 15:16:09 +1300 Subject: [PATCH] change token max_length to 300 Sometimes I want to use my own token as auth token here. For example, the token from facebook. But the length of facebook token is 250+, can you change the length to 300 to make it general? 40 is too small. --- rest_framework/authtoken/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest_framework/authtoken/models.py b/rest_framework/authtoken/models.py index a1a9315fa..7a3b1c425 100644 --- a/rest_framework/authtoken/models.py +++ b/rest_framework/authtoken/models.py @@ -18,7 +18,7 @@ class Token(models.Model): """ The default authorization token model. """ - key = models.CharField(max_length=40, primary_key=True) + key = models.CharField(max_length=300, primary_key=True) user = models.OneToOneField(AUTH_USER_MODEL, related_name='auth_token') created = models.DateTimeField(auto_now_add=True)