Skip to main content

A library to create periodic, cron-like tasks or single tasks with a specified execution/start time and schedule it to run in the future.

Project description

Django Future Tasks

PyPI version Run linter and tests Codecov

A library to create periodic, cron-like tasks or single tasks with a specified execution/start time and schedule it to run in the future.

Installation

  1. Install using pip:
pip install django-future-tasks
  1. Add the library to your INSTALLED_APPS list.
INSTALLED_APPS = [
    ...
    'django_future_tasks',
    ...
]
  1. Configure the task types in your settings.py according to your needs:
# within settings.py

FUTURE_TASK_TYPE_ONE = "task_one"
FUTURE_TASK_TYPE_TWO = "task_two"

FUTURE_TASK_TYPES = (
    (FUTURE_TASK_TYPE_ONE, _("Task 1")),
    (FUTURE_TASK_TYPE_TWO, _("Task 2")),
)

Usage

To receive a signal, register a receiver function using the signal future_task_signal and the task type as sender. The instance is the FutureTask object.

@receiver(future_task_signal, sender=intern(settings.FUTURE_TASK_TYPE_ONE))
def my_function(sender, instance, **kwargs):
    # do something

Command for starting the future task processing

python manage.py process_future_tasks

Command for starting the periodic future task processing

python manage.py populate_periodic_future_tasks

Django Compatibility Matrix

If your project uses an older version of Django or Django Rest Framework, you can choose an older version of this project.

This Project Python Version Django Version
1.3.* 3.9, 3.10, 3.11, 3.12, 3.13 4.2, 5.0, 5.1
1.2.* 3.8, 3.9, 3.10, 3.11 3.2, 4.1, 4.2
1.1.* 3.8, 3.9, 3.10, 3.11 3.2, 4.1, 4.2
1.0.* 3.8, 3.9, 3.10, 3.11 3.2, 4.0, 4.1

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-future-tasks-1.3.0.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

django_future_tasks-1.3.0-py3-none-any.whl (15.5 kB view details)

Uploaded Python 3

File details

Details for the file django-future-tasks-1.3.0.tar.gz.

File metadata

  • Download URL: django-future-tasks-1.3.0.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for django-future-tasks-1.3.0.tar.gz
Algorithm Hash digest
SHA256 133f44be512717818626ed8516368f1f62ca3efbf5c5a830387aa20d6caaf557
MD5 8af656ebf5a2a3c97376424467dcb64e
BLAKE2b-256 65add412a628d82cc2fc5689945173a10f5416e27cb3a327edcdb3fbf65b3332

See more details on using hashes here.

File details

Details for the file django_future_tasks-1.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for django_future_tasks-1.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2c39dc7ff598638d3cf4e6f243b1eb60e77e9fc3132cc0880ab5cd48b3e5ab87
MD5 68106eb30f16c2d83d37d488af1d55e3
BLAKE2b-256 e107086206a7d3e952439f1736c416b4546244764dab4e3cb73c3ed7d1e7506e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page