Django Tasks Scheduler
===================
[](https://github.com/django-commons/django-tasks-scheduler/actions/workflows/test.yml)

[](https://pypi.org/project/django-tasks-scheduler/)
Documentation can be found in https://django-tasks-scheduler.readthedocs.io/
# Usage
1. Update `settings.py` to include scheduler configuration:
```python
import os
from typing import Dict
from scheduler.types import SchedulerConfiguration, Broker, QueueConfiguration
INSTALLED_APPS = [
# ...
'scheduler',
# ...
]
SCHEDULER_CONFIG = SchedulerConfiguration(
EXECUTIONS_IN_PAGE=20,
SCHEDULER_INTERVAL=10,
BROKER=Broker.REDIS,
CALLBACK_TIMEOUT=60, # Callback timeout in seconds (success/failure/stopped)
# Default values, can be overriden per task/job
DEFAULT_SUCCESS_TTL=10 * 60, # Time To Live (TTL) in seconds to keep successful job results
DEFAULT_FAILURE_TTL=365 * 24 * 60 * 60, # Time To Live (TTL) in seconds to keep job failure information
DEFAULT_JOB_TTL=10 * 60, # Time To Live (TTL) in seconds to keep job information
DEFAULT_JOB_TIMEOUT=5 * 60, # timeout (seconds) for a job
# General configuration values
DEFAULT_WORKER_TTL=10 * 60, # Time To Live (TTL) in seconds to keep worker information after last heartbeat
DEFAULT_MAINTENANCE_TASK_INTERVAL=10 * 60, # The interval to run maintenance tasks in seconds. 10 minutes.
DEFAULT_JOB_MONITORING_INTERVAL=30, # The interval to monitor jobs in seconds.
SCHEDULER_FALLBACK_PERIOD_SECS=120, # Period (secs) to wait before requiring to reacquire locks
)
SCHEDULER_QUEUES: Dict[str, QueueConfiguration] = {
'default': QueueConfiguration(URL='redis://localhost:6379/0'),
}
```
2. Update `urls.py` to include scheduler urls:
```python
from django.urls import path, include
urlpatterns = [
# ...
path('scheduler/', include('scheduler.urls')),
]
```
3. Run migrations:
```bash
python manage.py migrate
```
4. Check out the admin views:

# Sponsor
django-tasks-scheduler is developed for free.
You can support this project by becoming a sponsor using [this link](https://github.com/sponsors/cunla).
# Contributing
Interested in contributing, providing suggestions, or submitting bugs? See
guidelines [at this link](.github/CONTRIBUTING.md).
Raw data
{
"_id": null,
"home_page": null,
"name": "django-tasks-scheduler",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": "Daniel Moran <daniel@moransoftware.ca>",
"keywords": "background-jobs, django, job-queue, redis, redis-queue, scheduled-jobs, task-queue, valkey",
"author": null,
"author_email": "Daniel Moran <daniel@moransoftware.ca>",
"download_url": "https://files.pythonhosted.org/packages/48/2f/ed1529ec25139516a3be62422e087900d424b43a937e4abb2106659e74c3/django_tasks_scheduler-4.0.6.tar.gz",
"platform": null,
"description": "Django Tasks Scheduler\n===================\n[](https://github.com/django-commons/django-tasks-scheduler/actions/workflows/test.yml)\n\n[](https://pypi.org/project/django-tasks-scheduler/)\n\nDocumentation can be found in https://django-tasks-scheduler.readthedocs.io/\n\n# Usage\n\n1. Update `settings.py` to include scheduler configuration:\n\n```python\nimport os\nfrom typing import Dict\nfrom scheduler.types import SchedulerConfiguration, Broker, QueueConfiguration\n\nINSTALLED_APPS = [\n # ... \n 'scheduler',\n # ...\n]\nSCHEDULER_CONFIG = SchedulerConfiguration(\n EXECUTIONS_IN_PAGE=20,\n SCHEDULER_INTERVAL=10,\n BROKER=Broker.REDIS,\n CALLBACK_TIMEOUT=60, # Callback timeout in seconds (success/failure/stopped)\n # Default values, can be overriden per task/job\n DEFAULT_SUCCESS_TTL=10 * 60, # Time To Live (TTL) in seconds to keep successful job results\n DEFAULT_FAILURE_TTL=365 * 24 * 60 * 60, # Time To Live (TTL) in seconds to keep job failure information\n DEFAULT_JOB_TTL=10 * 60, # Time To Live (TTL) in seconds to keep job information\n DEFAULT_JOB_TIMEOUT=5 * 60, # timeout (seconds) for a job\n # General configuration values\n DEFAULT_WORKER_TTL=10 * 60, # Time To Live (TTL) in seconds to keep worker information after last heartbeat\n DEFAULT_MAINTENANCE_TASK_INTERVAL=10 * 60, # The interval to run maintenance tasks in seconds. 10 minutes.\n DEFAULT_JOB_MONITORING_INTERVAL=30, # The interval to monitor jobs in seconds.\n SCHEDULER_FALLBACK_PERIOD_SECS=120, # Period (secs) to wait before requiring to reacquire locks\n)\nSCHEDULER_QUEUES: Dict[str, QueueConfiguration] = {\n 'default': QueueConfiguration(URL='redis://localhost:6379/0'),\n}\n```\n\n2. Update `urls.py` to include scheduler urls:\n\n```python\nfrom django.urls import path, include\n\nurlpatterns = [\n # ...\n path('scheduler/', include('scheduler.urls')),\n]\n```\n\n3. Run migrations:\n\n```bash\npython manage.py migrate\n```\n\n4. Check out the admin views:\n \n\n# Sponsor\n\ndjango-tasks-scheduler is developed for free.\n\nYou can support this project by becoming a sponsor using [this link](https://github.com/sponsors/cunla).\n\n# Contributing\n\nInterested in contributing, providing suggestions, or submitting bugs? See\nguidelines [at this link](.github/CONTRIBUTING.md).\n",
"bugtrack_url": null,
"license": null,
"summary": "An async job scheduler for django using redis/valkey brokers",
"version": "4.0.6",
"project_urls": {
"Bug Tracker": "https://github.com/django-commons/django-tasks-scheduler/issues",
"Documentation": "https://django-tasks-scheduler.readthedocs.io/",
"Funding": "https://github.com/sponsors/cunla",
"Homepage": "https://github.com/django-commons/django-tasks-scheduler"
},
"split_keywords": [
"background-jobs",
" django",
" job-queue",
" redis",
" redis-queue",
" scheduled-jobs",
" task-queue",
" valkey"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "07fa016ad138a6bd678668571a44e8914b6b9bf22d3adaff21059ac5a828d007",
"md5": "8fbfb0a93107dc46391b771b1b30e087",
"sha256": "2482b502b6ec3382ed8f5349b9119ea32a6d6be375321f284e4a031f9d356ed3"
},
"downloads": -1,
"filename": "django_tasks_scheduler-4.0.6-py3-none-any.whl",
"has_sig": false,
"md5_digest": "8fbfb0a93107dc46391b771b1b30e087",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 139383,
"upload_time": "2025-07-19T13:51:36",
"upload_time_iso_8601": "2025-07-19T13:51:36.628992Z",
"url": "https://files.pythonhosted.org/packages/07/fa/016ad138a6bd678668571a44e8914b6b9bf22d3adaff21059ac5a828d007/django_tasks_scheduler-4.0.6-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "482fed1529ec25139516a3be62422e087900d424b43a937e4abb2106659e74c3",
"md5": "147ccdf288860ce4731d2c390366af7d",
"sha256": "e452ea2be43d2f3854122f35b2b4a85b07305947118a60c74e7a3d24f0b753ba"
},
"downloads": -1,
"filename": "django_tasks_scheduler-4.0.6.tar.gz",
"has_sig": false,
"md5_digest": "147ccdf288860ce4731d2c390366af7d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 83604,
"upload_time": "2025-07-19T13:51:38",
"upload_time_iso_8601": "2025-07-19T13:51:38.311900Z",
"url": "https://files.pythonhosted.org/packages/48/2f/ed1529ec25139516a3be62422e087900d424b43a937e4abb2106659e74c3/django_tasks_scheduler-4.0.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-07-19 13:51:38",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "django-commons",
"github_project": "django-tasks-scheduler",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "django-tasks-scheduler"
}