I want to send an OTP to the user's email Id. I checked I can send the eamil through the Django's
send_eamil()
method with random no. I am using the following to generate the random no.
from django.utils.crypto import get_random_string
otp = get_random_string(6, allowed_chars='0123456789')
Now my question is how I can make it valid for a specific time in backend.
Should I use session or cache or something else to store the otp.
I have hardtime to figure out this.