Answer the question
In order to leave comments, you need to log in
How to properly set up uWSGI for Django?
I ran into a problem - mail is not sent from the forum site ( here is the question ).
More precisely, it is sent only to me and sometimes to others. Prescribed SPF, DKIM, etc. I send through a kind of "reliable" service pdd.yandex.ru.
I started testing through mail-tester.com. I wrote the testmail command for ./manage.py and I'm playing from the console - all letters reach the mail tester, give out 10 points out of 10, i.e. the letter is perfect!
So, they get it from the console, but from the server - nginx -> uwsgi -> django - Well, no way. Django happily reports back with the "Your mail has been sent" form, but nothing comes to the mail tester.
I started digging into the sources for sending mail in Django and came across this thing:
class EmailBackend(BaseEmailBackend):
"""
A wrapper that manages the SMTP network connection.
"""
def __init__(self, ...):
# ... скипаем все и в самом конце - вот:
self._lock = threading.RLock()
def send_messages(self, email_messages):
"""
Sends one or more EmailMessage objects and returns the number of email
messages sent.
"""
if not email_messages:
return
with self._lock:
# ... ну и дальше, собственно, отправляет.
return num_sent
[uwsgi]
...
master = true
processes = 4
enable-threads = true
single-interpreter = true
...
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question