django-rest-auth icon indicating copy to clipboard operation
django-rest-auth copied to clipboard

django.urls.exceptions.NoReverseMatch: Reverse for 'account_confirm_email' not found. 'account_confirm_email' is not a valid view function or pattern name.

Open gonzaloamadio opened this issue 5 years ago • 3 comments

I have my urls defined like this, to version my api using namespace:

api_v1 = [
//other apps urls
url(r'^api/v1/rest-auth/', include('rest_auth.urls')),                          
url(r'^api/v1/rest-auth/registration/', include('rest_auth.registration.urls')),
]
urlpatterns = [
url(r'', include((api_v1,'v1'), namespace="v1")),
]

And I "solved" taking rest-auth urls out from the "api/v1" group. Like this ] urlpatterns = [ url(r'', include((api_v1,'v1'), namespace="v1")), url(r'^rest-auth/', include('rest_auth.urls')),
url(r'^rest-auth/registration/', include('rest_auth.registration.urls')), ]

I have two issues here:

  1. How do I achieve versioning to work. I mean, with my original layout for urls.

  2. I now have this new error django.urls.exceptions.NoReverseMatch: Reverse for 'account_email_verification_sent' not found. 'account_email_verification_sent' is not a valid view function or pattern name.

gonzaloamadio avatar May 13 '19 14:05 gonzaloamadio

Ok, for my problem number two. I have solved it adding allauth urls .

url(r'^account/', include('allauth.urls')),

Is it the right solution? If yes, why? and also should be added to documentation, or something about it.

And my new problem is that a verification email is sent (in fact I only see it in console, as I am working locally, so no email is really sent), but when trying to enter the verification url, for example this one:

http://localhost:8888/account/confirm-email/NQ:1hQBzb:b6flMItw2Z2daR-NBnLxouOhYxo/

I have no answer, the url could not be accesed

[2019-05-14 00:32:30][INFO][django.server:124] "GET /account/confirm-email/NQ:1hQBzb:b6flMItw2Z2daR-NBnLxouOhYxo/ HTTP/1.1" 302 0

gonzaloamadio avatar May 13 '19 14:05 gonzaloamadio

Hey, Did you ever figure out why adding:

url(r'^account/', include('allauth.urls')),

got rid of the error. I have just came across the same issue myself, and everything ended up fine after adding the code above.

Thanks

Arkash707 avatar Aug 12 '21 00:08 Arkash707

Hey, Did you ever figure out why adding:

url(r'^account/', include('allauth.urls')),

got rid of the error. I have just came across the same issue myself, and everything ended up fine after adding the code above.

Thanks

Nope.. I left the project I was working with this. But never figured it out.

gonzaloamadio avatar Aug 12 '21 13:08 gonzaloamadio