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
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
- Install using pip:
pip install django-future-tasks
- Add the library to your INSTALLED_APPS list.
INSTALLED_APPS = [
...
'django_future_tasks',
...
]
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for django-future-tasks-1.1.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f163c74351ab766655c3c488ae26fe894e2ebd9dad3a5db94d95c3bcfce6ff7 |
|
MD5 | 6d093839c10c5fb8b16c097f1d3c521f |
|
BLAKE2b-256 | 2b2bcae3fc18c94956fac560926ce1bd9a87f7e485088b769dcf1db8e7fa1d1a |
Hashes for django_future_tasks-1.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2103dec4936fc26ed9a3874af0ff0a50417dd98e433743c9fcfc31c7a082c929 |
|
MD5 | 61fee9f8bbe4c26aaf8ad164bd972bab |
|
BLAKE2b-256 | b8966e0defbc49be644bced45ee9ddf2e2241204234772d7b065201e2431d89f |