mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-02 19:40:13 +03:00
Merge f5393ffbe0
into 216ac8a5c1
This commit is contained in:
commit
15cffee23f
|
@ -4,8 +4,10 @@ from hashlib import sha1
|
||||||
from rest_framework.compat import AUTH_USER_MODEL
|
from rest_framework.compat import AUTH_USER_MODEL
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.db import models
|
from django.db import models
|
||||||
|
from django.utils.encoding import python_2_unicode_compatible
|
||||||
|
|
||||||
|
|
||||||
|
@python_2_unicode_compatible
|
||||||
class Token(models.Model):
|
class Token(models.Model):
|
||||||
"""
|
"""
|
||||||
The default authorization token model.
|
The default authorization token model.
|
||||||
|
@ -31,5 +33,5 @@ class Token(models.Model):
|
||||||
unique = uuid.uuid4()
|
unique = uuid.uuid4()
|
||||||
return hmac.new(unique.bytes, digestmod=sha1).hexdigest()
|
return hmac.new(unique.bytes, digestmod=sha1).hexdigest()
|
||||||
|
|
||||||
def __unicode__(self):
|
def __str__(self):
|
||||||
return self.key
|
return self.key
|
||||||
|
|
Loading…
Reference in New Issue
Block a user