By Al3xs
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!
Heya,
have you considered using Celery and CeleryBeat for that? You can check that discussion here:
https://www.digitalocean.com/community/questions/how-to-set-up-django-app-redis-celery-a06db780-5335-493e-8158-7128ea7d2cc1 While it’s for a Droplet setup you can make a docker file and add Celery.
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 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
and CrontabSchedule
models in Django.Use cases:
In short:
That way you can control the tasks/cronjobs from your Django Admin
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.