Skip to main content

dj-tasks

https://badge.fury.io/py/dj-tasks.svg https://github.com/cfc603/dj-tasks/workflows/Django%20CI/badge.svg https://codecov.io/gh/cfc603/dj-tasks/branch/master/graph/badge.svg

A django app to run a collection of tasks in a management command.

Documentation

The full documentation is at https://dj-tasks.readthedocs.io.

Quickstart

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",
]

Running Tests

Does the code actually work?

$ make install-dev
$ make lint
$ make test

Credits

Tools used in rendering this package:

History

2.0.0 (2022-09-25)

  • handle exception when running individual tasks

  • Drop support for django <3.2

  • Add support for django 4.0 and 4.1

1.1.0 (2020-12-28)

  • add documentation of DJTASKS_LOCK_ID to Quickstart

  • update MakeFile to use current work flow

  • close database connection after each full run

  • add dj_tasks.tasks.DeleteOldTaskRunTask

  • flake8 fixes

  • add twine for easier releases

  • move to GitHub Actions from Travis CI

  • drop testing with tox

1.0.0 (2020-07-01)

  • require setting DJTASKS_LOCK_ID

0.1.0 (2020-06-05)

  • First release on PyPI.

Release files for dj-tasks 2.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dj-tasks 2.0.0
File Size Uploaded
dj-tasks-2.0.0.tar.gz 9.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dj-tasks 2.0.0
File Interpreter ABI Platform
dj_tasks-2.0.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 17.8 kB

Release files / dj-tasks-2.0.0.tar.gz

Download URL dj-tasks-2.0.0.tar.gz
Size 9.5 kB
Tags Source
SHA-256 checksum
How to use checksums
9ef04de48776cdd600fb72f9e8da99c13d8ea6ba576025f07a5335bbf82f3a89
BLAKE2b-256 checksum
How to use checksums
cd0a7477365d733fa094a9a5862f53cb44c03824867d35df9649278c357323e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.5

Release files / dj_tasks-2.0.0-py2.py3-none-any.whl

Download URL dj_tasks-2.0.0-py2.py3-none-any.whl
Size 8.3 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
5b6e2dc2b737029a33a5b20a935e1b7a54af98615f14bb9b4e1af8e4bead0eb1
BLAKE2b-256 checksum
How to use checksums
f05b217d32f77ae995428fa9c969258dc2444ca38c0223fe432468c4540cb4fe
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.3.0 pkginfo/1.6.1 requests/2.25.1 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.8.5

Release history Release notifications | RSS feed

This release

2.0.0 This release

2 release files

1.1.0

2 release files

1.0.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page