I am using django-fernet-fields, and documentation says By default, django-fernet-fields uses your SECRET_KEY setting as the encryption key. my SECRET_KEY in django is the one created by django let say it is "XXXX".
my dectypted text is "gAAAAABfIrFwizr11ppteAXE3MOMItPDNfNkr5a4HcS3oiT7ih4Ln7y6TeCC5uXWPS3Yup_0s7whK3T44ndNlJRgc0Ii4_s3_A=="
when I try to encrypt it by using the code below
token = SECRET_KEY
f = Fernet(token)
d =f.decrypt(b"gAAAAABfIrFwizr11ppteAXE3MOMItPDNfNkr5a4HcS3oiT7ih4Ln7y6TeCC5uXWPS3Yup_0s7whK3T44ndNlJRgc0Ii4_s3_A==")
print(d)
it throws an error, error is ValueError: Fernet key must be 32 url-safe base64-encoded bytes. how can i avoid this error?