NoReverseMatch at /accounts/password-reset/ for Password Reset in Django












2















Error- In Django after submitting email in "password-reset" page, I am getting this error.




NoReverseMatch at /accounts/password-reset/ Reverse for 'password_reset_done' not found. 'password_reset_done' is not a valid
view function or pattern name.






My Code in urls.py file-



urlpatterns = [
url(r'^password-reset/',
auth_views.PasswordResetView.as_view(
template_name='accounts/password_reset.html'),
name='password_reset'),

url(r'^password-reset/done/',
auth_views.PasswordResetDoneView.as_view(
template_name='accounts/password_reset_done.html'),
name='password_reset_done'),

url(r'^password-reset-confirm/<uidb64>/<token>/',
auth_views.PasswordResetConfirmView.as_view(
template_name='accounts/password_reset_confirm.html'),
name='password_reset_confirm'),
]


I also created separate HTML files for all pages in "accounts" directory.
By the way, I am following this tutorial on youtube - click here



Url.py Code Screenshot



Error Screenshot



password_reset.html Screenshot



password_reset_done.html Screenshot



password_reset_confirm.html screenshot



Github: Click Here










share|improve this question





























    2















    Error- In Django after submitting email in "password-reset" page, I am getting this error.




    NoReverseMatch at /accounts/password-reset/ Reverse for 'password_reset_done' not found. 'password_reset_done' is not a valid
    view function or pattern name.






    My Code in urls.py file-



    urlpatterns = [
    url(r'^password-reset/',
    auth_views.PasswordResetView.as_view(
    template_name='accounts/password_reset.html'),
    name='password_reset'),

    url(r'^password-reset/done/',
    auth_views.PasswordResetDoneView.as_view(
    template_name='accounts/password_reset_done.html'),
    name='password_reset_done'),

    url(r'^password-reset-confirm/<uidb64>/<token>/',
    auth_views.PasswordResetConfirmView.as_view(
    template_name='accounts/password_reset_confirm.html'),
    name='password_reset_confirm'),
    ]


    I also created separate HTML files for all pages in "accounts" directory.
    By the way, I am following this tutorial on youtube - click here



    Url.py Code Screenshot



    Error Screenshot



    password_reset.html Screenshot



    password_reset_done.html Screenshot



    password_reset_confirm.html screenshot



    Github: Click Here










    share|improve this question



























      2












      2








      2








      Error- In Django after submitting email in "password-reset" page, I am getting this error.




      NoReverseMatch at /accounts/password-reset/ Reverse for 'password_reset_done' not found. 'password_reset_done' is not a valid
      view function or pattern name.






      My Code in urls.py file-



      urlpatterns = [
      url(r'^password-reset/',
      auth_views.PasswordResetView.as_view(
      template_name='accounts/password_reset.html'),
      name='password_reset'),

      url(r'^password-reset/done/',
      auth_views.PasswordResetDoneView.as_view(
      template_name='accounts/password_reset_done.html'),
      name='password_reset_done'),

      url(r'^password-reset-confirm/<uidb64>/<token>/',
      auth_views.PasswordResetConfirmView.as_view(
      template_name='accounts/password_reset_confirm.html'),
      name='password_reset_confirm'),
      ]


      I also created separate HTML files for all pages in "accounts" directory.
      By the way, I am following this tutorial on youtube - click here



      Url.py Code Screenshot



      Error Screenshot



      password_reset.html Screenshot



      password_reset_done.html Screenshot



      password_reset_confirm.html screenshot



      Github: Click Here










      share|improve this question
















      Error- In Django after submitting email in "password-reset" page, I am getting this error.




      NoReverseMatch at /accounts/password-reset/ Reverse for 'password_reset_done' not found. 'password_reset_done' is not a valid
      view function or pattern name.






      My Code in urls.py file-



      urlpatterns = [
      url(r'^password-reset/',
      auth_views.PasswordResetView.as_view(
      template_name='accounts/password_reset.html'),
      name='password_reset'),

      url(r'^password-reset/done/',
      auth_views.PasswordResetDoneView.as_view(
      template_name='accounts/password_reset_done.html'),
      name='password_reset_done'),

      url(r'^password-reset-confirm/<uidb64>/<token>/',
      auth_views.PasswordResetConfirmView.as_view(
      template_name='accounts/password_reset_confirm.html'),
      name='password_reset_confirm'),
      ]


      I also created separate HTML files for all pages in "accounts" directory.
      By the way, I am following this tutorial on youtube - click here



      Url.py Code Screenshot



      Error Screenshot



      password_reset.html Screenshot



      password_reset_done.html Screenshot



      password_reset_confirm.html screenshot



      Github: Click Here







      python django django-models django-forms django-authentication






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jan 1 at 17:29







      Dipesh Paul

















      asked Jan 1 at 17:10









      Dipesh PaulDipesh Paul

      113




      113
























          2 Answers
          2






          active

          oldest

          votes


















          0














          How does the .html for url(r'^password-reset/done/',...) look like?






          share|improve this answer


























          • Review my post (question), I update it with my all screenshot. Thank you

            – Dipesh Paul
            Jan 1 at 17:30



















          0














          The issue is that you have included these views and templates inside of a separate django app called accounts. When you separate views and routes into a separate app, all of the route names that you specified will be namespaced.




          URL namespaces allow you to uniquely reverse named URL patterns even if different applications use the same URL names. It’s a good practice for third-party apps to always use namespaced URLs (as we did in the tutorial). Similarly, it also allows you to reverse URLs if multiple instances of an application are deployed. In other words, since multiple instances of a single application will share named URLs, namespaces provide a way to tell these named URLs apart.




          By default, the namespace assigned to those routes will be the application name (e.g., accounts) that you set in urls.py. This means that the fully qualified names for the views that you have specified are accounts:password_reset_done, etc. Thus, django cannot find the route / view that it is looking for which is the un-namespaced password_reset_done.



          You can fix this by (1) moving your account login / password reset views to the Dipesh_Pal application and specifying the routes in Dipesh_Pal/urls.py, or (2) explicitly setting a namespace of '' when including the accounts.urls in Dipesh_Pal/urls.py.






          share|improve this answer
























          • Would you please explain the method (2). How to "explicitly setting a namespace of '' when including the accounts.urls in Dipesh_Pal/urls.py"?

            – Dipesh Paul
            Jan 3 at 5:13











          • The referenced documentation offers several examples of explicitly setting a namespace. Let me know if you still need help after you read it.

            – 2ps
            Jan 3 at 6:41











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53997379%2fnoreversematch-at-accounts-password-reset-for-password-reset-in-django%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          How does the .html for url(r'^password-reset/done/',...) look like?






          share|improve this answer


























          • Review my post (question), I update it with my all screenshot. Thank you

            – Dipesh Paul
            Jan 1 at 17:30
















          0














          How does the .html for url(r'^password-reset/done/',...) look like?






          share|improve this answer


























          • Review my post (question), I update it with my all screenshot. Thank you

            – Dipesh Paul
            Jan 1 at 17:30














          0












          0








          0







          How does the .html for url(r'^password-reset/done/',...) look like?






          share|improve this answer















          How does the .html for url(r'^password-reset/done/',...) look like?







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Jan 1 at 18:08









          MBehtemam

          2,94284585




          2,94284585










          answered Jan 1 at 17:17









          Andreas NeumeierAndreas Neumeier

          734




          734













          • Review my post (question), I update it with my all screenshot. Thank you

            – Dipesh Paul
            Jan 1 at 17:30



















          • Review my post (question), I update it with my all screenshot. Thank you

            – Dipesh Paul
            Jan 1 at 17:30

















          Review my post (question), I update it with my all screenshot. Thank you

          – Dipesh Paul
          Jan 1 at 17:30





          Review my post (question), I update it with my all screenshot. Thank you

          – Dipesh Paul
          Jan 1 at 17:30













          0














          The issue is that you have included these views and templates inside of a separate django app called accounts. When you separate views and routes into a separate app, all of the route names that you specified will be namespaced.




          URL namespaces allow you to uniquely reverse named URL patterns even if different applications use the same URL names. It’s a good practice for third-party apps to always use namespaced URLs (as we did in the tutorial). Similarly, it also allows you to reverse URLs if multiple instances of an application are deployed. In other words, since multiple instances of a single application will share named URLs, namespaces provide a way to tell these named URLs apart.




          By default, the namespace assigned to those routes will be the application name (e.g., accounts) that you set in urls.py. This means that the fully qualified names for the views that you have specified are accounts:password_reset_done, etc. Thus, django cannot find the route / view that it is looking for which is the un-namespaced password_reset_done.



          You can fix this by (1) moving your account login / password reset views to the Dipesh_Pal application and specifying the routes in Dipesh_Pal/urls.py, or (2) explicitly setting a namespace of '' when including the accounts.urls in Dipesh_Pal/urls.py.






          share|improve this answer
























          • Would you please explain the method (2). How to "explicitly setting a namespace of '' when including the accounts.urls in Dipesh_Pal/urls.py"?

            – Dipesh Paul
            Jan 3 at 5:13











          • The referenced documentation offers several examples of explicitly setting a namespace. Let me know if you still need help after you read it.

            – 2ps
            Jan 3 at 6:41
















          0














          The issue is that you have included these views and templates inside of a separate django app called accounts. When you separate views and routes into a separate app, all of the route names that you specified will be namespaced.




          URL namespaces allow you to uniquely reverse named URL patterns even if different applications use the same URL names. It’s a good practice for third-party apps to always use namespaced URLs (as we did in the tutorial). Similarly, it also allows you to reverse URLs if multiple instances of an application are deployed. In other words, since multiple instances of a single application will share named URLs, namespaces provide a way to tell these named URLs apart.




          By default, the namespace assigned to those routes will be the application name (e.g., accounts) that you set in urls.py. This means that the fully qualified names for the views that you have specified are accounts:password_reset_done, etc. Thus, django cannot find the route / view that it is looking for which is the un-namespaced password_reset_done.



          You can fix this by (1) moving your account login / password reset views to the Dipesh_Pal application and specifying the routes in Dipesh_Pal/urls.py, or (2) explicitly setting a namespace of '' when including the accounts.urls in Dipesh_Pal/urls.py.






          share|improve this answer
























          • Would you please explain the method (2). How to "explicitly setting a namespace of '' when including the accounts.urls in Dipesh_Pal/urls.py"?

            – Dipesh Paul
            Jan 3 at 5:13











          • The referenced documentation offers several examples of explicitly setting a namespace. Let me know if you still need help after you read it.

            – 2ps
            Jan 3 at 6:41














          0












          0








          0







          The issue is that you have included these views and templates inside of a separate django app called accounts. When you separate views and routes into a separate app, all of the route names that you specified will be namespaced.




          URL namespaces allow you to uniquely reverse named URL patterns even if different applications use the same URL names. It’s a good practice for third-party apps to always use namespaced URLs (as we did in the tutorial). Similarly, it also allows you to reverse URLs if multiple instances of an application are deployed. In other words, since multiple instances of a single application will share named URLs, namespaces provide a way to tell these named URLs apart.




          By default, the namespace assigned to those routes will be the application name (e.g., accounts) that you set in urls.py. This means that the fully qualified names for the views that you have specified are accounts:password_reset_done, etc. Thus, django cannot find the route / view that it is looking for which is the un-namespaced password_reset_done.



          You can fix this by (1) moving your account login / password reset views to the Dipesh_Pal application and specifying the routes in Dipesh_Pal/urls.py, or (2) explicitly setting a namespace of '' when including the accounts.urls in Dipesh_Pal/urls.py.






          share|improve this answer













          The issue is that you have included these views and templates inside of a separate django app called accounts. When you separate views and routes into a separate app, all of the route names that you specified will be namespaced.




          URL namespaces allow you to uniquely reverse named URL patterns even if different applications use the same URL names. It’s a good practice for third-party apps to always use namespaced URLs (as we did in the tutorial). Similarly, it also allows you to reverse URLs if multiple instances of an application are deployed. In other words, since multiple instances of a single application will share named URLs, namespaces provide a way to tell these named URLs apart.




          By default, the namespace assigned to those routes will be the application name (e.g., accounts) that you set in urls.py. This means that the fully qualified names for the views that you have specified are accounts:password_reset_done, etc. Thus, django cannot find the route / view that it is looking for which is the un-namespaced password_reset_done.



          You can fix this by (1) moving your account login / password reset views to the Dipesh_Pal application and specifying the routes in Dipesh_Pal/urls.py, or (2) explicitly setting a namespace of '' when including the accounts.urls in Dipesh_Pal/urls.py.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jan 2 at 5:26









          2ps2ps

          8,06221131




          8,06221131













          • Would you please explain the method (2). How to "explicitly setting a namespace of '' when including the accounts.urls in Dipesh_Pal/urls.py"?

            – Dipesh Paul
            Jan 3 at 5:13











          • The referenced documentation offers several examples of explicitly setting a namespace. Let me know if you still need help after you read it.

            – 2ps
            Jan 3 at 6:41



















          • Would you please explain the method (2). How to "explicitly setting a namespace of '' when including the accounts.urls in Dipesh_Pal/urls.py"?

            – Dipesh Paul
            Jan 3 at 5:13











          • The referenced documentation offers several examples of explicitly setting a namespace. Let me know if you still need help after you read it.

            – 2ps
            Jan 3 at 6:41

















          Would you please explain the method (2). How to "explicitly setting a namespace of '' when including the accounts.urls in Dipesh_Pal/urls.py"?

          – Dipesh Paul
          Jan 3 at 5:13





          Would you please explain the method (2). How to "explicitly setting a namespace of '' when including the accounts.urls in Dipesh_Pal/urls.py"?

          – Dipesh Paul
          Jan 3 at 5:13













          The referenced documentation offers several examples of explicitly setting a namespace. Let me know if you still need help after you read it.

          – 2ps
          Jan 3 at 6:41





          The referenced documentation offers several examples of explicitly setting a namespace. Let me know if you still need help after you read it.

          – 2ps
          Jan 3 at 6:41


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53997379%2fnoreversematch-at-accounts-password-reset-for-password-reset-in-django%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          MongoDB - Not Authorized To Execute Command

          in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith

          How to fix TextFormField cause rebuild widget in Flutter