loads
Reverse of dumps(), raise BadSignature if signature fails.
The serializer is expected to accept a bytestring.
def loads(
s: string,
key: string = None,
salt: string = "django.core.signing",
serializer: class = JSONSerializer,
max_age: integer = None,
fallback_keys: list = None
) - > any
Reverse of dumps(), raise BadSignature if signature fails. The serializer is expected to accept a bytestring.
Parameters
| Name | Type | Description |
|---|---|---|
| s | string | The signed and encoded string to be verified and deserialized |
| key | string = None | The secret key used to verify the signature; defaults to settings.SECRET_KEY |
| salt | string = "django.core.signing" | A namespace used to ensure that signatures created for different purposes are not interchangeable |
| serializer | class = JSONSerializer | The class used to deserialize the unsigned string back into a Python object |
| max_age | integer = None | The maximum allowed age of the signature in seconds; raises SignatureExpired if exceeded |
| fallback_keys | list = None | A list of secondary secret keys to attempt verification against if the primary key fails |
Returns
| Type | Description |
|---|---|
any | The original Python object that was previously signed and serialized |