NoReverseMatch at /accounts/password-reset/ for Password Reset in Django
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
add a comment |
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
add a comment |
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
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
python django django-models django-forms django-authentication
edited Jan 1 at 17:29
Dipesh Paul
asked Jan 1 at 17:10
Dipesh PaulDipesh Paul
113
113
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
How does the .html
for url(r'^password-reset/done/',...)
look like?
Review my post (question), I update it with my all screenshot. Thank you
– Dipesh Paul
Jan 1 at 17:30
add a comment |
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
.
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
add a comment |
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
How does the .html
for url(r'^password-reset/done/',...)
look like?
Review my post (question), I update it with my all screenshot. Thank you
– Dipesh Paul
Jan 1 at 17:30
add a comment |
How does the .html
for url(r'^password-reset/done/',...)
look like?
Review my post (question), I update it with my all screenshot. Thank you
– Dipesh Paul
Jan 1 at 17:30
add a comment |
How does the .html
for url(r'^password-reset/done/',...)
look like?
How does the .html
for url(r'^password-reset/done/',...)
look like?
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
add a comment |
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
add a comment |
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
.
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
add a comment |
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
.
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
add a comment |
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
.
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
.
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
add a comment |
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
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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