mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-27 08:29:59 +03:00
Remove reliance on binascii for converting binary to hex
This commit is contained in:
parent
51169060b6
commit
a5e189c761
|
@ -1,4 +1,3 @@
|
|||
import binascii
|
||||
import os
|
||||
|
||||
from django.conf import settings
|
||||
|
@ -34,7 +33,7 @@ class Token(models.Model):
|
|||
|
||||
@classmethod
|
||||
def generate_key(cls):
|
||||
return binascii.hexlify(os.urandom(20)).decode()
|
||||
return (os.urandom(20)).hex()
|
||||
|
||||
def __str__(self):
|
||||
return self.key
|
||||
|
|
Loading…
Reference in New Issue
Block a user