1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| from itsdangerous import TimedJSONWebSignatureSerializer as Serializer
from itsdangerous import SignatureExpired, BadSignature
from django.conf import settings
serializer = Serializer(settings.SECRET_KEY, 3600)
secret = serializer.dumps({"confirmID": new_user.id})
secret.decode()
data = serializer.loads(secret)
|