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 verison of Django or Django Rest Framework, you can choose an older version of this project.

This Project Python Version Django Version
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.1.1.tar.gz (9.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_future_tasks-1.1.1-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: django-future-tasks-1.1.1.tar.gz
  • Upload date:
  • Size: 9.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.18

File hashes

Hashes for django-future-tasks-1.1.1.tar.gz
Algorithm Hash digest
SHA256 70132d7a6e2e9bd691834f7bad125f9d96eae1b498d4f9285bbfb1f971922865
MD5 cee42c581381c7d1ce5e6adc0edc31c9
BLAKE2b-256 03a2b78204cc781b70f7ec40bc23d2000fb6af8951e4ae097fc98e966e8de5bd

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for django_future_tasks-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 00fad9392d2b9da02f2dd0ed9e385613823c1eb71c7cdba2764ce4517199d418
MD5 8ad2c5df5c0ce3a414bea99e7fadb5b3
BLAKE2b-256 906164557f38c5b842070ef93cb9d5fe08f67d0fcee1a69fcb88392d33ad87c9

See more details on using hashes here.

Supported by

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