I’m looking for an option to run a cronjob in the background that calls a django-admin command. Is there any information about how to approach this using DO’s App Platform?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Heya,
have you considered using Celery and CeleryBeat for that? You can check that discussion here:
elery:
Celery is an asynchronous task queue and job scheduler for Python applications. It allows you to run tasks in the background (asynchronously) rather than during the main execution of your application, making it ideal for:
It works by:
CeleryBeat:
CeleryBeat is an extension for Celery that adds support for periodic task scheduling. It allows you to define tasks that should run at specific intervals (similar to Cron jobs).
Key features:
PeriodicTask
andCrontabSchedule
models in Django.Use cases:
In short:
That way you can control the tasks/cronjobs from your Django Admin