Tivix / django-rest-auth

This app makes it extremely easy to build Django powered SPA's (Single Page App) or Mobile apps exposing all registration and authentication related functionality as CBV's (Class Base View) and REST (JSON)
www.tivix.com
MIT License
2.41k stars 661 forks source link

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

Open gonzaloamadio opened 5 years ago

gonzaloamadio commented 5 years ago

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 commented 5 years ago

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

Arkash707 commented 3 years ago

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

gonzaloamadio commented 3 years ago

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.