I have a Python script in my project that grabs data from a few APIs and inserts it into my database. Everything runs fine if I run the script manually, but I don't know where I should place the file. I also want to setup a cronjob for the script so that it can run on its own. Where would be the ideal place for the script? Thanks
Asked
Active
Viewed 40 times
0
-
Does this answer your question? [Set up a scheduled job?](https://stackoverflow.com/questions/573618/set-up-a-scheduled-job) – Someguy123 Aug 04 '20 at 06:02
1 Answers
0
You should use Celery https://pypi.org/project/django-celery/
With celery @task decorator you can turn a function into a task that will run automatically on given condition With celery beat, you will be able to schedule the task (run on every Monday, or run on every day at 6PM, or run every 5 minutes, etc.)

Hien
- 61
- 7