Django email activation feature failing
the view
def activate(request, uidb64, token):
try:
uid = force_str(urlsafe_base64_decode(uidb64))
user = User.objects.get(pk=uid)
except (TypeError, ValueError, OverflowError, User.DoesNotExist):
raise Http404("Invalid activation link")
if generate_token.check_token(user, token):
user.is_active = True
user.save()
login(request, user)
messages.success(request, "Your account has been activated!")
return redirect(reverse('index'))
else:
raise ValidationError("Invalid activation link")
the url
path('activate/<uidb64>/<token>/',views.activate,name='activate'),
the token.py file
from django.contrib.auth.tokens import PasswordResetTokenGenerator
from six import text_type
class TokenGenerator(PasswordResetTokenGenerator):
def _make_hash_value(self, user, timestamp):
return (text_type(user.pk) + text_type(timestamp))
generate_token = TokenGenerator()
the confirmation email is indeed being sent but whenever i click on that link i get this error !
