I have configured Django to use a file backend for email sending on my local machine. This seemed to work fine earlier on, and all mails were recorded in the directory I had specified in my settings.py
file:
EMAIL_BACKEND = 'django.core.mail.backends.filebased.EmailBackend'
EMAIL_FILE_PATH = '/code/mails/'
However, this suddenly stopped working. I have checked the permissions of the folder, and this seems to be fine. There is no error that I can see. I'm using docker, and when I start the Python server I have the logs shown in my terminal. Normally when there is an error I see it there. But nothing appears. To test things, I have renamed the folder and tried sending a mail. This time, no error appears either. In production, where my settings.py
are different but all else is the same, the emails are sent out just fine. So the code seems to be working, but the local filebased backend seems to be a problem.
Anybody any idea?
I have configured these log settings:
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'handlers': {
'file': {
'level': 'DEBUG',
'class': 'logging.FileHandler',
'filename': '/code/logs/debug.log',
},
},
'loggers': {
'django': {
'handlers': ['file'],
'level': 'DEBUG',
'propagate': True,
},
},
}
The logs seem to work fine and provide detailed logging; but none of it related to the e-mail error.
manage.py
, and if so does it work there? – Alburg/code/mails
internal to the container or mounted from the host? – Fiddlededee