Skip to main content

# Django RQ Scheduler

A database backed job scheduler for Django RQ.

## Requirements

Currently, when you pip install Django RQ Scheduler the following packages are also installed.

  • django >= 2

  • django-model-utils >= 2.4

  • django-rq >= 0.9.3 (Django RQ requires RQ >= 0.5.5)

  • rq-scheduler >= 0.6.0

  • pytz >= 2015.7

  • croniter >= 0.3.24

Testing also requires:

  • factory_boy >= 2.6.1

  • psycopg2 >= 2.6.1

## Usage

### Install

Use pip to install:

` pip install django-rq-scheduler `

### Update Django Settings

  1. In settings.py, add django_rq and scheduler to INSTALLED_APPS:

INSTALLED_APPS = [
    ...
    'django_rq',
    'scheduler',
    ...
]
  1. Configure Django RQ. See https://github.com/ui/django-rq#installation

### Migrate

The last step is migrate the database:

` ./manage.py migrate `

## Creating a Job

See http://python-rq.org/docs/jobs/ or https://github.com/ui/django-rq#job-decorator

An example:

myapp.jobs.py

@job
def count():
    return 1 + 1

## Scheduling a Job

### Scheduled Job

  1. Sign into the Django Admin site, http://localhost:8000/admin/ and locate the Django RQ Scheduler section.

  2. Click on the Add link for Scheduled Job.

  3. Enter a unique name for the job in the Name field.

  4. In the Callable field, enter a Python dot notation path to the method that defines the job. For the example above, that would be myapp.jobs.count

  5. Choose your Queue. Side Note: The queues listed are defined in the Django Settings.

  6. Enter the time the job is to be executed in the Scheduled time field. Side Note: Enter the date via the browser’s local timezone, the time will automatically convert UTC.

  7. Click the Save button to schedule the job.

### Repeatable Job

  1. Sign into the Django Admin site, http://localhost:8000/admin/ and locate the Django RQ Scheduler section.

  2. Click on the Add link for Repeatable Job

  3. Enter a unique name for the job in the Name field.

  4. In the Callable field, enter a Python dot notation path to the method that defines the job. For the example above, that would be myapp.jobs.count

  5. Choose your Queue. Side Note: The queues listed are defined in the Django Settings.

  6. Enter the time the first job is to be executed in the Scheduled time field. Side Note: Enter the date via the browser’s local timezone, the time will automatically convert UTC.

  7. Enter an Interval, and choose the Interval unit. This will calculate the time before the function is called again.

  8. In the Repeat field, enter the number of time the job is to be ran. Leaving the field empty, means the job will be scheduled to run forever.

  9. Click the Save button to schedule the job.

## Reporting issues or Features

Please report issues via [GitHub Issues](https://github.com/istrategylabs/django-rq-scheduler/issues) .

Metadata

Release files for readwise-django-rq-scheduler 1.2.1

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

Source distribution (sdist)

Source distribution for readwise-django-rq-scheduler 1.2.1
File Size Uploaded
readwise-django-rq-scheduler-1.2.1.tar.gz 8.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for readwise-django-rq-scheduler 1.2.1
File Interpreter ABI Platform
readwise_django_rq_scheduler-1.2.1-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 21.6 kB

Release files / readwise-django-rq-scheduler-1.2.1.tar.gz

Download URL readwise-django-rq-scheduler-1.2.1.tar.gz
Size 8.6 kB
Tags Source
SHA-256 checksum
How to use checksums
7ac77a766f3c3cf7f1e67e8e4f7a9ca95958002aa01e9d5fb41e7cebb6da57a0
BLAKE2b-256 checksum
How to use checksums
fa2479416d5cdb6390f7cc114cccd09552f47ff5e5fae814f222a248d3bc5402
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.7

Release files / readwise_django_rq_scheduler-1.2.1-py2.py3-none-any.whl

Download URL readwise_django_rq_scheduler-1.2.1-py2.py3-none-any.whl
Size 13.0 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
933c779ebba8abf24fbc17b99418f31c0767e67831fc013c0944b56e82c15dfc
BLAKE2b-256 checksum
How to use checksums
b22e373519b881c8b0c0864abb03a5e19e8a2ad1e6cb063184c1f259ad7151d7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/46.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.7

Release history Release notifications | RSS feed

This release

1.2.1 This release

2 release files

1.2

2 release files

1.1.4

2 release files

1.1.3

2 release files

1.1.2

1 release file

1.1.1

1 release file

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