foo290 / Django-Verify-Email

A two-step verification for new accounts by verifying email.
GNU General Public License v3.0
104 stars 33 forks source link

NoReverseMatch after clicking verification link #59

Closed bphariharan1301 closed 1 year ago

bphariharan1301 commented 1 year ago

I keep on getting this issue:-

NoReverseMatch at /verification/user/verify-email/dGVzdEBnbWFpbC5jb20=/Ymt2OGowLWJlM2ZkMWZmNTgxMWIyYjFjNzNiYjIwYTgyMjg3MjBh/ Reverse for 'accounts.views.login' not found. 'accounts.views.login' is not a valid view function or pattern name.

Which indeed exists under accounts/urls.py and the function is at accounts/views.py

accounts/urls.py urlpatterns = [ path('login/', views.login, name='login'), ]

And when I looked into the app_configurations.py file I found that the LOGIN_URL parameter was taking a default value which was not present in the application. So, I tried adding that under my_project/settings.py

LOGIN_URL = 'accounts.views.login'

But, I do not know why it again throws the same error. Can you please tell me where I'm going wrong

Thank you

PS: I have also attached a image of the error here

foo290 commented 1 year ago

Try LOGIN_URL='login', basically same as u'hve given name='login' in urlpatterns path

bphariharan1301 commented 1 year ago

Thanks you so much man! It worked!

Out of curiosity why it didn't work when I gave

LOGIN_URL = 'accounts.views.login' Considering both means the same

Thank you!

foo290 commented 1 year ago

u are providing name= in pattern for that view

fevrec commented 1 year ago

had the same problem, thanks for the answer !