A django app to run a collection of tasks in a management command.
The full documentation is at https://dj-tasks.readthedocs.io.
Install dj-tasks:
pip install dj-tasks
Add it to your INSTALLED_APPS
:
# project/settings.py
INSTALLED_APPS = [
...
'dj_tasks',
...
]
Create a task:
# your_app/tasks.py
from dj_tasks.tasks import Task
class YourTask(Task):
name = "Your Task"
frequency = 60
def run(self):
print("Your custom code...")
Add to your DJTASKS_TASKS
settings:
# project/settings.py
DJTASKS_LOCK_ID = "your_django_project"
DJTASKS_TASKS = [
"your_app.tasks.YourTask",
]
Does the code actually work?
$ make install-dev $ make lint $ make test
Tools used in rendering this package: