Trying to get this tutorial to work in my app: https://medium.com/@frfahim/django-registration-with-confirmation-email-bb5da011e4ef
The 'uid' fails whether or not I include the .decode().
message = render_to_string('premium/activation_email.html', {'user':user,
'token': account_activation_token.make_token(user),
#this fails both with the .decode() and without
'uid':urlsafe_base64_encode(force_bytes(user.pk)).decode(),
})
mail_subject = 'Activate your membership account.'
send_mail(mail_subject, message,'info@mysite.com', [request.user.email])
These are the two errors:
Reverse for 'activate' not found. 'activate' is not a valid view function or pattern name
Then if I add .decode():
str object has no attribute decode()
here is my urls.py with the activate tag:
path('activate/<uidb64>/<token>/', views.activate, 'activate'),
my activate view is exactly the same as the one in the tutorial