This change seems to have introduced a subtle issue. In Python 3 `generate_key` returns a 'binary string' (e.g. ` b'2d341eea05bc8823d480423d772f246576401306'`) which results on `Token.key` being a binary string which I believe is causing `TypeError b'326f50029aac5deb1ccecd5aa5c66bc8816e43cf' is not JSON serializable` elsewhere in in drf when the token is created.
 
In Python 2  
Old version: `binascii.hexlify(os.urandom(20))` > '3be95efcfdd73e1b6393ede2da2736f7088aca07'
New version: `hmac.new(unique.bytes, digestmod=sha1).hexdigest()` > '8242d4eb32f7b756bd130ab91af839f0f637ef3c'

In Python 3  
Old version: `binascii.hexlify(os.urandom(20))` > b'2d341eea05bc8823d480423d772f246576401306'
New version: ``hmac.new(unique.bytes, digestmod=sha1).hexdigest()` > 'ea7e44fc1ca2219aac3e74498b362fd98393db8a'

Adding `decode()` should fix the issue, `binascii.hexlify(os.urandom(20)).decode()`.

@tomchristie do you think adding `decode()` is a good idea and do you want me to create a pull request?