Hello everyone Help please, teach python django I need to send a message to an e-mail at a certain time Began to teach pynsq but I can not figure it out Sample code, send a simple message

def mail(request): form = MailForm() if request.method == 'POST': form = MailForm(request.POST) if form.is_valid(): name = form.cleaned_data.get('name') descriptions = form.cleaned_data.get('descriptions') time = form.cleaned_data.get('time') send_mail(name, descriptions, settings.EMAIL_HOST_USER, ['info@mail.ru']) 

How to cause pynsq what to prescribe?

Closed due to the fact that the issue is too common for participants aleksandr barakin , user194374, user207618, cheops , Bald Aug 15 '16 at 3:54 .

Please correct the question so that it describes the specific problem with sufficient detail to determine the appropriate answer. Do not ask a few questions at once. See “How to ask a good question?” For clarification. If the question can be reformulated according to the rules set out in the certificate , edit it .

  • 2
    A realtime distributed messaging platform nsq.io - something I did not understand, and here email. For asynchronous sending there are cellery. NSQ is a json, http messaging. Sending email in real time is something not familiar. For mailings, the first time is better github.com/ui/django-post_office or similar ready-made. When everything will be clear, "saw" your "bicycle" for the task. - Igor

1 answer 1

Create a console command in management / commands / sendmail.py with sending mail.

By cron (or by scheduler in Windows) at the right time to perform

 manage.py sendmail