19π
As your sending test in Django shell works it means that your email settings are well configured.
If you still not getting the email from the password_reset you have to search your problem in this field.
You have to know that the password reset email is sent only to active users (is_active), and only if they have an usable password (has_usable_password).
If an user has an invalid password, Django will just silently not send the reset email.
Use the following code in the Django shell to test all your users:
from django.contrib.auth import get_user_model
[(u.email, u.is_active, u.has_usable_password()) for u in get_user_model().objects.all()]
- How to serve static files to AWS when deploying Django app (`python manage.py collectstatic` didn't work)?
- Docker + Celery tells me not to run as root, but once I don't, I lack permissions to run
2π
Try if the mail is sent or not:
./manage.py shell
from django.core.mail import send_mail
send_mail('Subject here', 'Here is the message.', 'from@example.com',
['to@example.com'], fail_silently=False)
if the return is 0, then you have to reconfigure your email settings. Make sure you input the right credential. Check the documentation https://docs.djangoproject.com/en/dev/topics/email/#send-mail
- Django form with unknown number of checkbox fields and multiple actions
- Auto Populate Slug field django
- Django Tutorial: name 'HttpResponse' is not defined
- Processing a Django UploadedFile as UTF-8 with universal newlines
- Django message template tag checking
- How to insert a row of data to a table using Django's ORM
- How can I tell Django templates not to parse a block containing code that looks like template tags?
- Exclude URLs from Django REST Swagger
2π
This is a long shot, but weirdly enough I donβt have EMAIL_BACKEND set in my settings file. I thought I did, but as I just looked through it I could not find it. I donβt use Gmail, but my email sending works fine, including password reset. Also, looking at your error log in the console, it seems to be related to βbackendβ. So my answer is: try removing the EMAIL_BACKEND setting.
- If..else custom template tag
- Django and Custom Form validation
- How to test a Django on_commit hook without clearing the database?
2π
In gmail create a separate password for mail sending (as app) located in advanced settings
It should be around 12-16 characters in length
Then give it a try
- Django β 'WhereNode' object has no attribute 'output_field' error
- Creating a Portable Python (local install) for Linux
2π
Add below settings
# ....
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.gmail.com'
EMAIL_PORT = 587
EMAIL_HOST_USER = '<your gmail>'
EMAIL_HOST_PASSWORD = '<your password>'
EMAIL_USE_TLS = True
# ....
Now, try to send an email from django shell
from django.core.mail import send_mail
send_mail('Subject', 'Body infromation', '<your from email>', ['<your to email>'])
- Django order_by sum of fields
- How to get a name of last migration programmatically?
- Django-allauth SITE_ID error
1π
Your settings appear to be correct
You must first see if you are logged in
also you can use this in your main url
from django.contrib.auth import views as auth_views
path('reset_password/',auth_views.PasswordResetView.as_view(),name='password_reset)
- Celery β No module named five
- Django.db.utils.OperationalError: near "[]": syntax error
- Unknown command: shell_plus and βsettings
- Django not sending error emails β how can I debug?
- In a schemamigration, what should be the default value for a null=False field which I'm sure that won't have null values?
0π
Thatβs how I fixed this issue:
I was also facing this issue. But when I checked my database, my database was empty. There was not a single user in my database. So, make sure you have a user in your database with this email.
- Celerybeat not executing periodic tasks
- Difference between django-webtest and selenium
- How to set dynamic page_size in DRF PageNumberPagination
- Django β Supervisor : exited too quickly