anexia-it / django-rest-passwordreset

An extension of django rest framework, providing a configurable password reset strategy
BSD 3-Clause "New" or "Revised" License
419 stars 148 forks source link

django.urls.exceptions.NoReverseMatch: 'password_reset' is not a registered namespace #126

Open DevWonder01 opened 3 years ago

DevWonder01 commented 3 years ago

I have followed all the necessary steps involved in installing and configuring this module

Here's My Url - path('api/password_reset/', include('django_rest_passwordreset.urls', namespace='password_reset')),

but i still get this error ,please help me fix this i need it asap

loganknecht commented 3 years ago

I am experiencing this issue as well.

Does anyone have guidance on what needs to be done to make the namespace work?

DevWonder01 commented 3 years ago

I am experiencing this issue as well.

Does anyone have guidance on what needs to be done to make the namespace work?

I'm working on something to fix this issue with another alternative ,i will let you know as soon as it's ready

DevWonder01 commented 3 years ago

Guys Please help if you know the solution or can offer a guide

loganknecht commented 3 years ago

@ArcBase My solution was to not use this library.

I did this

  1. Make an endpoint for the password reset start
  2. Do typical request validation
  3. Fire off an email through mail chimp. The email includes a url that has the token and email embedded in it
  4. Open the URL in the front-end and fill in the correct data using the token and email
  5. Submit form on front end with the pre-filled data and the new password
  6. Receive request in the API to reset
  7. Validate reset request
  8. Return success or failure

I created a simple model called ResetForgottenPassword which doesn't store the token, but does track creation and expiration date of the token itself, and then uses that to help logic.

Not sure if this helps, but it's a lot more obvious and easier to debug than this library.

DevWonder01 commented 3 years ago

@ArcBase My solution was to not use this library.

I did this

  1. Make an endpoint for the password reset start
  2. Do typical request validation
  3. Fire off an email through mail chimp. The email includes a url that has the token and email embedded in it
  4. Open the URL in the front-end and fill in the correct data using the token and email
  5. Submit form on front end with the pre-filled data and the new password
  6. Receive request in the API to reset
  7. Validate reset request
  8. Return success or failure

I created a simple model called ResetForgottenPassword which doesn't store the token, but does track creation and expiration date of the token itself, and then uses that to help logic.

Not sure if this helps, but it's a lot more obvious and easier to debug than this library.

ok thanks alot , i was working on something very similar to this too

Gagaro commented 3 years ago

I had the same issue as well. It happens because my urls are in another namespace, so the password_reset namespace was indeed incorrect.

I changed reverse('password_reset:reset-password-confirm') to reverse('user:password_reset:reset-password-confirm') to include my own namespace and it solved it.