mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-29 17:39:48 +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
|
import os
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
|
@ -34,7 +33,7 @@ class Token(models.Model):
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def generate_key(cls):
|
def generate_key(cls):
|
||||||
return binascii.hexlify(os.urandom(20)).decode()
|
return (os.urandom(20)).hex()
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.key
|
return self.key
|
||||||
|
|
Loading…
Reference in New Issue
Block a user