3

Using path in project's urls.py, and using re_path in app's urls.py, I got the NoReverseMatch error, my project's urls.py:

from django.contrib import admin
from django.urls import path, include, re_path

urlpatterns = [
    path('user/', include('user.urls', namespace='user'))
]

My app's urls.py:

urlpatterns = [
    re_path('activate/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/',
            views.activate_account, name='activate'),
]

I can't get the correct url, the error message:

django.urls.exceptions.NoReverseMatch: Reverse for 'activate' with keyword arguments '{'uidb64': b'Mjc', 'token': '4tv-d4250012f57297ad82a6'}' not found. 1 pattern(s) tried: ['user\\/activate/(?P<uidb64>[0-9A-Za-z_\\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/']
zeleven
  • 436
  • 1
  • 6
  • 21

1 Answers1

2

well you need to decode the uuid before sending it to the url

like uuid.decode()

Exprator
  • 26,992
  • 6
  • 47
  • 59