hi , in the minute : 16:30 how show how to reset the password ,but he use the default admin panel , my question is how i can change it to be able to use a custom templates ?
To customize the template for the page where users set a new password after requesting a password reset in Django, you can create your own custom template. Django allows you to override the built-in templates provided by the `auth_views` with your own templates. Here are the steps to customize the password reset template: 1. **Create a New Template**: - First, create a new HTML template for the password reset confirmation page. You can create a file named `password_reset_confirm.html` in your app's `templates` directory. If the `templates` directory doesn't exist in your app, create one. Example directory structure: ``` your_app/ ├── templates/ │ └── registration/ │ └── password_reset_confirm.html ``` 2. **Customize the Template**: - In your `password_reset_confirm.html` file, you can write the HTML and customize the layout and content as you desire. You can use Django template tags to display dynamic information if needed. For example: ```html
Password Reset Confirmation
Password Reset Confirmation You can now set a new password for your account: {% csrf_token %} {{ form.as_p }} Set New Password
``` 3. **Update the URL Configuration**: - In your URL configuration (the `urlpatterns` list you provided), make sure that the `PasswordResetConfirmView` is using your custom template. You can do this by specifying the `template_name` parameter as follows: ```python path('reset///', auth_views.PasswordResetConfirmView.as_view( template_name='registration/password_reset_confirm.html'), name='password_reset_confirm'), ``` Ensure that the `template_name` parameter points to the location of your custom template. 4. **Testing**: - After making these changes, you can test the password reset functionality. When a user requests a password reset and clicks on the link in their email, they should be taken to your custom password reset confirmation page. By following these steps, you can create and use a custom template for the password reset confirmation page in your Django project.
hey im having issues with the django admin page coming up for the everything but the password change page, im not sure what the issue could be since there isnt any errors that i can find in the html files and the urls file
you solved my problem sir....i was using allauth for entire authentication and turned out that it was because of allauth i am getting connection error while sending email to the user...thanks again
Howcome you don't have a PasswordResetDoneView but you have two PasswordResetCompleteView instances? Guessing it's just a typo but then weird that it seems to work correctly?
Hello, great video indeed. But I have a problem. I'm using a bootstrap template for my site and logo's image source for mobile is in a JS file. When I open the site on mobile sized screen it doesn't show the logo and gives this error in browser console. GET localhost:8000/password_change/static/img/logo_mobile1.png 404 (Not Found) and this is from my JS file $('nav#dropdown').meanmenu({ siteLogo: "" }); Can you please Help me resolve this issue? Thanks
IF THE ADMIN SHOWS UP INSTEAD OF YOUR OWN TEMPLATES: If you are seeing the success pages of the Django administration site instead of your own log out page, check the INSTALLED_APPS setting of your project and make sure that django.contrib.admin comes after the account application. Both templates are located in the same relative path and the Django template loader will use the first one it finds.
A customized template will be appreciated for password reset confirmation just like for the other views. Something like (password_reset_confirmation.html).
HI , While opening password reset link I am getting following error: NoReverseMatch at /reset/NA/set-password/ gist.github.com/Maha-Waqar/dedaa4d236b817e4a1ca15f1d85823f4 I have followed each and every bit of your toturial. Kindly have a look
I'm keeping up with the course. It's amazing.
When it's done I'll build a rest api and an android app that communicates with it
hi , in the minute : 16:30 how show how to reset the password ,but he use the default admin panel , my question is how i can change it to be able to use a custom templates ?
To customize the template for the page where users set a new password after requesting a password reset in Django, you can create your own custom template. Django allows you to override the built-in templates provided by the `auth_views` with your own templates.
Here are the steps to customize the password reset template:
1. **Create a New Template**:
- First, create a new HTML template for the password reset confirmation page. You can create a file named `password_reset_confirm.html` in your app's `templates` directory. If the `templates` directory doesn't exist in your app, create one.
Example directory structure:
```
your_app/
├── templates/
│ └── registration/
│ └── password_reset_confirm.html
```
2. **Customize the Template**:
- In your `password_reset_confirm.html` file, you can write the HTML and customize the layout and content as you desire. You can use Django template tags to display dynamic information if needed. For example:
```html
Password Reset Confirmation
Password Reset Confirmation
You can now set a new password for your account:
{% csrf_token %}
{{ form.as_p }}
Set New Password
```
3. **Update the URL Configuration**:
- In your URL configuration (the `urlpatterns` list you provided), make sure that the `PasswordResetConfirmView` is using your custom template. You can do this by specifying the `template_name` parameter as follows:
```python
path('reset///', auth_views.PasswordResetConfirmView.as_view(
template_name='registration/password_reset_confirm.html'), name='password_reset_confirm'),
```
Ensure that the `template_name` parameter points to the location of your custom template.
4. **Testing**:
- After making these changes, you can test the password reset functionality. When a user requests a password reset and clicks on the link in their email, they should be taken to your custom password reset confirmation page.
By following these steps, you can create and use a custom template for the password reset confirmation page in your Django project.
@@ahmedkhaldi2057 Goated Comment
You have been an awesome teacher, but only one of these views is working for me
Crisp and clear explanation. well done man
hey im having issues with the django admin page coming up for the everything but the password change page, im not sure what the issue could be since there isnt any errors that i can find in the html files and the urls file
Hi Mitch, in which video are you adding the email details if DEBUG = FALSE ?
you solved my problem sir....i was using allauth for entire authentication and turned out that it was because of allauth i am getting connection error while sending email to the user...thanks again
Thank you so much for this video, it was really helpful towards building my project! Keep it up
Nice work. It would be better if the code font size were larger. Greetings
Awesome 🙏
Great. Can you teach us how to extend Password ResetView for searching account by username or email for sending password reset email.
Thank You So much 😇😇
Hey I kept having a popup which confusese when I update the password. I do not know what the resason. Can you please help
Howcome you don't have a PasswordResetDoneView but you have two PasswordResetCompleteView instances? Guessing it's just a typo but then weird that it seems to work correctly?
You forgot one page in templates/registration. It should appear 'password_reset_confirm.html'
How to get email from mobile device instead of entering on web page
Hello, great video indeed. But I have a problem. I'm using a bootstrap template for my site and logo's image source for mobile is in a JS file. When I open the site on mobile sized screen it doesn't show the logo and gives this error in browser console.
GET localhost:8000/password_change/static/img/logo_mobile1.png 404 (Not Found)
and this is from my JS file
$('nav#dropdown').meanmenu({ siteLogo: "" });
Can you please Help me resolve this issue? Thanks
NoReverseMatch at /reset/done
Reverse for ' ' not found
Please help
hi , how can i get copy of your code please ?
He literally said it's on his GitHub
@@udaykhalsa can u share the github link of source code
link in description for copy paste sources would be nice :(
IF THE ADMIN SHOWS UP INSTEAD OF YOUR OWN TEMPLATES:
If you are seeing the success pages of the Django administration site instead of your own log out page, check the INSTALLED_APPS setting of your project and make sure that django.contrib.admin comes after the account application. Both templates are located in the same relative path and the Django template loader will use the first one it finds.
Thank you very much. I've been searching for this everywhere.
whey u dont add template name in url PasswordRestConfirm to make form costum
just copy the password_change.html file and edit it. remove the unnecessary field for old password. you then add a template name
you didn't override the passord_reset_confirm.html template, it will render Django admin default template.
hy plzz send me link all code plzz
Send Emails with Django for Password Reset (PRODUCTION ENVIRONMENT): th-cam.com/video/NdE-Lg2A-zw/w-d-xo.html
A customized template will be appreciated for password reset confirmation just like for the other views. Something like (password_reset_confirmation.html).
I managed to customize the template
@@thee_enigma4301 Can you please share the code?
@@thee_enigma4301 plz share code
HI , While opening password reset link I am getting following error:
NoReverseMatch at /reset/NA/set-password/
gist.github.com/Maha-Waqar/dedaa4d236b817e4a1ca15f1d85823f4
I have followed each and every bit of your toturial. Kindly have a look
Default Django pass reset doesn’t work anymore, tho it doesn’t matter since we won’t use that anyway