I have a site I’m working on that I’d like to add an option to sign up for a weekly newsletter type thing. I did a lot of looking around, and I was wondering if the python schedule library is an okay thing to use for this (https://schedule.readthedocs.io/en/stable/).
Could I have my website running and then a scheduler running in tandem that runs a django management command to send emails to those who sign up? I’m fairly new to this kind of thing, so I just wanted to check since I couldn’t really find any info of other people doing this.
I have a script that sends emails and when I use the scheduler to send them every however many minutes it works, but I’m just wondering about the scalability of this. I think I’d like to avoid using something like celery since it seems like sort of a big solution to a small problem.
2
Answers
I think Celery is a great option to achieve your goal.
You will also need another tools, according to the docs:
Take a look at the rest of the doc
I would say celery is often an overkill, especially if you are running a single task because it requires a message transport server and the library has a lot of unnecessary features for a simple use case.
I would recommand to use
django-q2
which provides a full django admin integration and can run using your app database.