-
Notifications
You must be signed in to change notification settings - Fork 288
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NoReverseMatch #6
Comments
I'm getting the same problem... How did you solve it? |
if you use django version 2.0 or above, you should use message = render_to_string('account_activation_email.html', {
'user': user,
'domain': current_site.domain,
'uid': urlsafe_base64_encode(force_bytes(user.pk)).decode(),
'token': account_activation_token.make_token(user),
}) Or you can use |
i used this solution 'uid': urlsafe_base64_encode(force_bytes(user.pk)).decode(), and now i have an 'str' object has no attribute 'decode' |
There is no need to use decode() function here, it should be just: You should use context args in activation function as well:
And the main problem is in the urls of your app that including activation view. You should use slug: |
I’m trying what you propose but it gives me another problem my views.py class ActivateAccount(View):
|
I'm trying your email verification on my site, but I get this error:
NoReverseMatch
Reverse for 'activate' with keyword arguments '{'uidb64': b'MTM', 'token': '52d-53339dd970c622ae0d32'}' not found. 1 pattern(s) tried: ['accounts/activate/(?P[0-9A-Za-z_\-]+)/(?P[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$']
/root/anaconda3/lib/python3.7/site-packages/django/urls/resolvers.py in _reverse_with_prefix, line 622
/root/anaconda3/bin/python
3.7.0
['/root/gtd', '/root/anaconda3/lib/python37.zip', '/root/anaconda3/lib/python3.7', '/root/anaconda3/lib/python3.7/lib-dynload', '/root/anaconda3/lib/python3.7/site-packages']
The error seemed to be at:
http://{{ domain }}{% url 'activate' uidb64=uid token=token %}
The text was updated successfully, but these errors were encountered: