How to run regularly scheduled tasks on AppPlatform?

Basically the title - have a Django app running on the app platform and I’d like to run some basic tasks on a regular schedule. Diving into celery just for that feels like overkill so hoping there is something I can set up cronjobs for within the app platform.

Submit an answer

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!

Sign In or Sign Up to Answer

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.

Site Moderator
Site Moderator badge
May 22, 2023

To accomplish scheduled tasks with your Django App running on the App Platform, Cron Jobs are not natively supported as of now.

You can check our tutorial on How To Setup a Job Scheduler on DigitalOcean App Platform

A job scheduler allows you to schedule tasks at specific times, intervals, or dates, freeing you to focus on more important work. In this tutorial, we’ll show you how to set up a job scheduler in App Platform using a Docker container that runs cron as an App Platform Worker.

  1. Use a custom worker: By defining a custom worker component in your app specification, you can run scheduled tasks using Python libraries like schedule or APScheduler. It may have a different entrypoint for the scheduled tasks separate from your main app.

  2. External cron services: You can use a third-party cron service to make requests to your app on scheduled intervals, triggering the tasks you want to run.

Here’s some more information on DigitalOcean App Platform. Remember to check our documentation for any updates on cron job support in the future.

Hope that this helps!

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

card icon
Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Sign up
card icon
Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We’d like to help.

Learn more
card icon
Become a contributor

You get paid; we donate to tech nonprofits.

Learn more
Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow – whether you’re running one virtual machine or ten thousand.

Learn more ->
DigitalOcean Cloud Control Panel