A library to create a task with a specified execution/start time and schedule it to run in the future.
Project description
Django Future Tasks
A library to create a task 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
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.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
Close
Hashes for django-future-tasks-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2478aa04c2b050652779f879cd9a7c16e8dd8c1eb109710d4e9f32ff46ef0639 |
|
MD5 | 8db91e9ea7d5959197ffd641b22ccbbf |
|
BLAKE2b-256 | 307e7e837cf5d8a933d97047849cea2f40cc94a8e770ddc487d0d4b4a30d087d |
Close
Hashes for django_future_tasks-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 48549d81cc709349952d6fc87439ea20ed5b5ca939924e45817ba4bf96273d54 |
|
MD5 | 7130d910466df4650760270358741e87 |
|
BLAKE2b-256 | 72397c11f9dcb23b9db6bfe7fb430ddf4c7d204e63a8c20a2162495b595a6198 |