Marvin
Marvin

Reputation: 99

Can I edit cronjobs using my Django application?

I am creating a Django application for school project. I want to schedule jobs (every (work)day on 9:00 and 17:00). I am trying to do it with Celery right now, but I stuck very hard on it, and as the deadline is in sight, I want to use alternative options: just a cronjob. I think just the cronjob works fine, but the user should be able to edit the times of the cronjobs using the Django web application (so not logging in to SSH, edit the crontab manually).

Is this possible? Can't find anything about it on the internet.

Upvotes: 1

Views: 858

Answers (1)

Emin Mastizada
Emin Mastizada

Reputation: 1405

You need django-celery-beat plugin that adds new models to the django admin named "Periodic tasks" where you can manage cron schedule for your tasks.

As an alternate, if you really do not want to run a background tasks, you can create django management commands and use a library like python-crontab to add/modify/remove cron jobs in the system.

Upvotes: 1

Related Questions