Django Cronjobs
django-cronjobs is a simple Django app that runs registered cron jobs via a management command.
Installing
To install django-cronjobs, first install via pip or easy_install, then just add cronjobs to your INSTALLED_APPS.
Registering a cron job
django-cronjobs includes a decorator to register a cronjob, and discovers registered jobs in the module <appname>.cron.
For example:
# myapp/cron.py
import cronjobs
@cronjobs.register
def periodic_task():
pass
django-cronjobs will then recognize periodic_task as a valid job.
Running a cron job
To run a registered cron job, use the cron management command:
$ ./manage.py cron <job_name>
So to run periodic_task from above, you could use:
$ ./manage.py cron periodic_task
Additional arguments can be passed after the name of the task.
Locks
By default, cron jobs are locked so that only one copy of a given job can be running at a time. If you need to override this behavior, you can pass the lock kwarg to register:
from cronjobs import register
@register(lock=False)
def my_cron_job():
# Multiple instances of me can run simultaneously.
If you run multiple sets of cronjobs on the same file system and need the locks to not collide, set CRONJOB_LOCK_PREFIX to something unique in your Django settings.
Metadata
Release files for django-cronjobs 0.2.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| django-cronjobs-0.2.3.tar.gz | 3.9 kB | Without provenance | Details for django-cronjobs-0.2.3.tar.gz |
Release files / django-cronjobs-0.2.3.tar.gz
| Download URL | django-cronjobs-0.2.3.tar.gz |
|---|---|
| Size | 3.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
177295b1442400c92cdb67e8e18f9ff5946fb442f85813b9d0837823722ea08d
|
|
BLAKE2b-256 checksum How to use checksums |
d78ef73213675e7953ffdee57b3b94014b21590a838de528dfc502c2509cd49e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for django-cronjobs 0.2.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.