django-serverless-cron ?

django-serverless-cron is a Django app with a simpler approach running cron jobs. This is done through exposing a HTTP endpoint to invoke the jobs that allows you to run any task without having to manage always-on infrastructure.

There is also an option to run jobs via management commands and the Django admin.


This is essentially a replacement/supplement for a traditional OS ‘cron’ or ‘job scheduler’ system:

  • Serverless cron jobs no-longer a pain.
  • Schedule jobs to run at a frequency that is less than 1 min. (crontab is limited to 1 min)
  • The machine running crontab is no longer a single point of failure.
  • The problem with the above systems is that they are often configured at the operating system level, which means their configuration is probably not easily ‘portable’ and ‘debug-able’ (if you are developing on Windows, the scheduler works differently from Linux or Unix). Also can not easily be integrated into a development environment.
  • Manually triggered cron jobs. Eg: via the Django Admin.
  • Alternative to cron services that aren’t always available on free (and sometimes paid) web hosting services.
  • Easier access to cron job execution logs and monitoring execution failures.
  • No need to learn crontab. Think of it as a friendlier alternative to traditional cron jobs. Simple cron job creation. No need for cron syntax, no guessing on job frequency. Easy controls.


Documentation is graciously hosted at


Feel free to make pull requests and submit issues/requests. Find more detailed instructions under the contributing section.

Alternatively, you can leave a star on the repo to show your support. ?



Install Django Serverless Cron:

pip install django-serverless-cron


Add it to your INSTALLED_APPS:

    # ...
    # ...

Add jobs to your settings file:

    # (
    #   '1_hours',                       # frequency (seconds, minutes, hours, days, weeks) -> in this case, every one hour
    #   '',  # path to task/function functions -> in this case, send_mail_function()
    #   {'kwarg1': 'foo'}                # kwargs passed to the function
    # ),
        {'kwarg1': 'foo', 'kwarg2': 'bar'}
        {"is_bulk": True}

URL patterns

Add the jobs to your URL patterns:

from django_serverless_cron import urls as django_serverless_cron_urls

urlpatterns = [
    # ...
    url(r'^', include(django_serverless_cron_urls))


python migrate

Running Jobs

In Development

Running Jobs through HTTP requests

Call the /run path to run all jobs:


curl http://localhost:8000/run


import requests

x = requests.get('http://localhost:8000/run')

Running Jobs through the management command

This will run the jobs every 30 seconds:

python serverless_cron_run

You can alternatively add the –single_run=’True’ option to run the jobs just once.

In Production

Similar to in development, we can call the /run path via fully managed services which are usually ridiculously cheap. Examples:

Related media

For more learning check out:


Tools used in rendering this package:


View Github