Django Schedules
This app allows you to define routines that should run periodically (e.g. every day at 0:00, ...). They will be triggered by systemd-timers or cron.
Define Routines
- Add "schedules" to your
INSTALLED_APPSsetting. - Add a file called
schedules.pyto your django app. - Define functions in this file.
- Each function which is a timer job should be decorated by the
registerdecorater:
Example:
import django_schedules
@django_schedules.register(mins=0, hour=0)
def run_at_midnight(**kwargs):
print('hello')
@django_schedules.register(mins=3, hour=18, day_of_month=2, month='5,11', lock=False, job_name='foobar')
def bar(**kwargs):
"""
Run on 2.5. and 2.11. at 18:03.
Don't use locking (allow to run this job more than once at the same time).
The job will be called 'foobar'.'
"""
print('hello')
Commands
Now you can use following management commands:
./manage.py schedules_list # list all available jobs
./manage.py schedules_update_systemd [-u user] [--out-path path] # generate systemd units (for user 'user' (default root))
./manage.py schedules_update_cron [-u user] [-o file] # generate crontab "code" (for user 'user' (default root)) (and write it to file file)
./manage.py schedules_run [<app_name>:]<job_name> [additional_args, ...] # run the job app_name:job_name
Installation
- Write your code (see above)
- Run
./manage.py schedules_listto verify all jobs are registered as expected - Run
./manage.py schedules_update_systemd -u $DJANGO_USER [--out-path /etc/systemd/system/]to generate systemd units - Or run
./manage.py schedules_update_cron -u $DJANGO_USER -o /etc/cron.d/$DJANGO_PROJECT_NAMEto let the jobs run by system cron
Metadata
Release files for django-schedules 1.1.2
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_schedules-1.1.2.tar.gz | 42.9 kB | Without provenance | Details for django_schedules-1.1.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| django_schedules-1.1.2-py3-none-any.whl | Python 3 | none | any | Details for django_schedules-1.1.2-py3-none-any.whl |
Total release size: 56.4 kB
Release files / django_schedules-1.1.2.tar.gz
| Download URL | django_schedules-1.1.2.tar.gz |
|---|---|
| Size | 42.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5107d2003466b669ef8aa67317860c2a76cf253a940af9c829114493a7f4b09a
|
|
BLAKE2b-256 checksum How to use checksums |
ca5af6f59cc8e4b5d2c48d72f691125378c8811f57e0d443694c7e7e7656a071
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.20 {"installer":{"name":"uv","version":"0.9.20","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / django_schedules-1.1.2-py3-none-any.whl
| Download URL | django_schedules-1.1.2-py3-none-any.whl |
|---|---|
| Size | 13.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
be339eb9565a6577ce5085cbc3d3f91cf44b91eb6114eab442e887d87574ffb3
|
|
BLAKE2b-256 checksum How to use checksums |
93cb60afda45cb43f43e6661a7aa6329de3df9427c7731b8db99af4224e6c417
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.9.20 {"installer":{"name":"uv","version":"0.9.20","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Arch Linux","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for django-schedules 1.1.2
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.