Mirco
I mean into template
Mirco
The form that redirects the user to password complete
Luis
password_reset_done.html ?
Mirco
Yup
Mirco
The one that generates ReverseMatch
Manish
no action field url is passed on that
Manish
https://del.dog/wirixorike.cs
Mirco
Ook so when u click on request new password, you don't have exceptions right ?
Manish
right
Mirco
And which is the last form before ReverseMatch exception ?
Mirco
reset done ?
Manish
yeah
Mirco
And you have overwritten it ?
Manish
Luis
Do you have password_reset_done.html ?
Mirco
Exactly
Mirco
Share it pls
Luis
yes i do have
Yes, please, share it
Manish
https://github.com/itzmanish/blog this repo
Manish
Yes, please, share it
https://del.dog/uhaxecorik.json password_reset_done.html
Rajjix
Interruption: In line 22 in your urls add a slash in front of password_reset/done —->”/password_reset/done”
Manish
Interruption: In line 22 in your urls add a slash in front of password_reset/done —->”/password_reset/done”
WARNINGS: ?: (urls.W002) Your URL pattern '/password_reset/complete/' [name='password_reset_complete'] has a route beginning with a '/'. Remove this slash as it is unnecessary. If this pattern is targeted inan include(), ensure the include() pattern has a trailing '/'. ?: (urls.W002) Your URL pattern '/password_reset/done/' [name='password_reset_done'] has a route beginning with a '/'. Remove this slash as it is unnecessary. If this pattern is targeted in an include(), ensure the include() pattern has a trailing '/'. System check identified 2 issues (0 silenced). October 22, 2018 - 14:36:36 Django version 2.1.1, using settings 'second.settings' Starting development server at http://127.0.0.1:8000/ Quit the server with CONTROL-C.
Mirco
https://github.com/itzmanish/blog this repo
Where is password_reset_complete.html ?
Mirco
You have defined the template in your url but you actually don't have any file
Manish
my gosh!!
Mirco
So Django does not know what display
Mirco
😂
Manish
my useless mistake
Mirco
Try to create an even stupid password complete template and tell us if it will work
Manish
sorry i wasted alot of your times. 😭😭
Luis
Hahahah
Luis
No problem
Mirco
No worries 😂
Luis
sorry i wasted alot of your times. 😭😭
Any way, check the @Rajjix warning
Mirco
yeah i removed that
👌👌 Add the template file and test the flow again And study how to write tests for py and Django, so you can find earlier mistakes like that
Luis
Hahahahahaha
Luis
device*
Mirco
same problem
ReverseMatch ?
Manish
https://screenshots.firefox.com/6omsX8Z5sO1kb7Zd/localhost
Mirco
Try to pass to password reset confirm post_reset_redirect = reverse('profiles:password_reset_complete')
Mirco
where to add this?
urls.py Password reset confirm url When you do as_view()
Manish
okay
Manish
i will update you guys as soon i get success with this
Mirco
Ook
Luis
Nice!
Mirco
I'll save this tip
It's inside django confirm reset pwd code There's an if condition, if post_reset_redirect is None then Django will try with reverse('password_reset_complete') Otherwise with that one u pass inside url pattern to that param
Rajjix
man
Luis
Oooh and the namespace was breaking the reverse function
Rajjix
go back to your old urls files and add this path('password_reset', auth_views.PasswordResetView.as_view(template_name='password_reset.html', email_template_name='password_reset_email.html', subject_template_name='password_reset_subject.txt', success_url='/dashboard/password_reset/done/'),
Rajjix
i just cloned the project and it works fine with this
Mirco
It's my idea, so trying to force the reverse with the namespaced url will give us the answer
Rajjix
that's what i said earlier when i told him to add a starting slash let me check what line
Rajjix
line 18 replace it with my given line
Mirco
@maharudra108 install Django debug toolbar when debug is True , it will help you to understand lots of things
Mirco
I'll save this tip too... I'm new to DJango too
imho it's helpful, it can tell you all about that request Context variables, template name, url etc.
Rajjix
Interruption: In line 22 in your urls add a slash in front of password_reset/done —->”/password_reset/done”
this was meant for the success url btw he missundertood, it wasn’t the correct one anyway
Rajjix
/dashboard/password_reset/done is correct
Combot
Luis López (1) has increased reputation of Mirco (8)
Luis
/dashboard/password_reset/done is correct
You're right. Full url path will work.
Mirco
Even without specifying that success url, Django would be gone to password reset done url
Mirco
By default Django has that success url set to reverse('password_reset_done') If I remember well the code 😂
Rajjix
Even without specifying that success url, Django would be gone to password reset done url
i don’t even write all those url patterns just django.auth.urls and override their templates less of a headache with all that unnecessary mess
Mirco
i don’t even write all those url patterns just django.auth.urls and override their templates less of a headache with all that unnecessary mess
Yup, but maybe he's learning Django so he wanna define urls by himself to have a better idea about the flow
Luis
Or just following "how to" tutorial.
Anonymous
hi i'm new member here I created a template in Django, and initialized a very simple HTML code just to test it out with some variables loaded from the views.py file. The HTML file is loaded, but the variables are not and thanks