A django app to run a collection of tasks in a management command.
Project description
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_TASKS = [
"your_app.tasks.Task",
]
Running Tests
Does the code actually work?
source <YOURVIRTUALENV>/bin/activate (myenv) $ pip install tox (myenv) $ tox
Credits
Tools used in rendering this package:
History
1.0.0 (2020-07-01)
require setting DJTASKS_LOCK_ID
0.1.0 (2020-06-05)
First release on PyPI.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dj-tasks-1.0.0.tar.gz
(7.2 kB
view hashes)
Built Distribution
Close
Hashes for dj_tasks-1.0.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 50e3c3bec70f0ef110c89be225cef719c9f00621922ad31cada69463fdd752c0 |
|
MD5 | cc4c514e1691fc37ac0b5fb5b992581f |
|
BLAKE2b-256 | 9185ab8a854f0cbbb79e49314b9c27283a770c8cd95d551f556325b8a51acbb7 |