So basicaly when a user register , i put the is_active=False i generate a verification_code and i send it within an email ,
but i want that verification_code to be used within 1Hour otherwise verification_code is set to null to my database
email=email,
age=age,
gender=gender,
phone_number=phone_number,
city=city,
is_active=False
occupation=occupation,)
user_obj.set_password(password)
user_obj.save()
activation_link = 'http://127.0.0.1:4200/' + random_string(200)
subject = 'Confirm email'
from_email = EMAIL_HOST_USER
to = [email,]
html_message = render_to_string('forget_password.html', {'activation_link': activation_link})
text_message = strip_tags(html_message)
msg = EmailMultiAlternatives(subject, text_message, to=to, from_email=from_email)
msg.attach_alternative(html_message, "text/html")
msg.send()
return Response("Mail sended", status=status.HTTP_200_OK)```