Periodical sending of emails. How to implement?

Good time of day.
I have vushka preview of the order(collects the sold products and generates the ordering provider), and this vushki there is another Augusta, which prepares the order and sends an email to the supplier. So, for some providers need to send the orders automatically, and for various customers from different periods. How do I implement it?
I have a store written on Django Oscar(framework Django). If there is any question as to the structure of models or code - to complete the question.
Thanks in advance for the answer.
June 26th 19 at 14:02
1 answer
June 26th 19 at 14:04
Solution
The easiest way is to write your own management command and run it reversed. Another way is to use a task queue Celery, for which you can define asynchronous tasks run on schedule.
It can be something easy, like https://github.com/coleifer/huey/
Celery for this gun on mosquitoes. - glennie_Mer commented on June 26th 19 at 14:07
And it is possible that the task used for Celery he ran the post wusky? What would the logic not to write anew? - morris.Dickens commented on June 26th 19 at 14:10
: make a refactoring and move functionality - marilyne_Roh commented on June 26th 19 at 14:13
: I would recommend to refactor moving the logic somewhere else, where it is equally convenient to use as the view, and the background task. But then again, there is a simple method - CZK can invoke curl with certain parameters that would be stupid to pull the damper. - samir39 commented on June 26th 19 at 14:16
: to be honest, never had them never use. I need to read this. - samir39 commented on June 26th 19 at 14:19
: : Thanks for the advice, will do the refactoring, and sketch task for Celery. - morris.Dickens commented on June 26th 19 at 14:22
: for thanks you can accept the answer. - samir39 commented on June 26th 19 at 14:25
:
For periodic sending - better KC + Django commands
To send in the event of Celera - marilyne_Roh commented on June 26th 19 at 14:28
We have so selera raised, so think through it... - morris.Dickens commented on June 26th 19 at 14:31

Find more questions by tags DjangoPython