There are some requirements as the following detail, I am supposed that it should be executed by running a background task process in Django because It will take some time to do it. If I really want to do like that.
What is a good way to run Background Tasks in Django for building Report and sending an email later?
- User request buiding report on a web page.
Once clicked “Build Excel Report” button, This request is sent to the Django web site and a return message to inform the user that “Already accepted your request and we will send a report to your email later.”
and finished the task
- After that, Django will sent the command to the python script responsible for creating a report in that as a background task. It will probably take some time to do it .
This python script can be a script in Django folder or outside or script that has been set in the window task scheduler.
If the process complete then The scrip will send the report through email, including the attached report file.
I found some articles as below but not sure whether they are suitable for this my requirement or not.
It seems like that is Supported versions and compatibility
Python: 2.7, 3.4-3.7
Django: 1.8, 1.11, 2.1, 2.2
But my environment is python 3.8 and Django 3.1
This link looks interesting but seems complicated to configure. It uses celery, redis
Anyone can share Any ideas with me .