(request, uidb64, token)
return redirect("/")
Verify one time link sent to a users email
Verify one time link sent to a users email
Verify one time link sent to a users email
def email_verify_account(request, uidb64, token):
    "Verify one time link sent to a users email"

    uid = force_text(urlsafe_base64_decode(uidb64))
    user = User.objects.filter(pk=uid).first()

    if user and account_verification_token.check_token(user, token):
        Profile.objects.filter(user=user).update(email_verified=True)
        login(request, user, backend="django.contrib.auth.backends.ModelBackend")
        messages.success(request, "Email verified!")
        return redirect(reverse('user_profile', kwargs=dict(uid=user.profile.uid)))

    messages.error(request, "Link is expired.")
    return redirect("/")
def email_verify_account ( request , uidb64 , token ) : uid = force_text ( urlsafe_base64_decode ( uidb64 ) ) user = User . objects . filter ( pk = uid ) . first ( ) if user and account_verification_token . check_token ( user , token ) : Profile . objects . filter ( user = user ) . update ( email_verified = True ) login ( request , user , backend = "django.contrib.auth.backends.ModelBackend" ) messages . success ( request , "Email verified!" ) return redirect ( reverse ( 'user_profile' , kwargs = dict ( uid = user . profile . uid ) ) ) messages . error ( request , "Link is expired." ) return redirect ( "/" )