All Projects → isl-x → django-rq-scheduler

isl-x / django-rq-scheduler

Licence: MIT license
A database backed job scheduler for Django RQ and RQ Scheduler

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to django-rq-scheduler

rearq
A distributed task queue built with asyncio and redis, with built-in web interface
Stars: ✭ 81 (+107.69%)
Mutual labels:  rq
hook-slinger
A generic service to send, retry, and manage webhooks.
Stars: ✭ 88 (+125.64%)
Mutual labels:  rq
rqmonitor
Flask based more dynamic and actionable frontend dashboard for monitoring Redis Queue 👩🏿‍💻 http://python-rq.org
Stars: ✭ 152 (+289.74%)
Mutual labels:  rq
metroid
Metroid - Metro for Django (An async Azure Service Bus receiver, triggering task in Celery/RQ)
Stars: ✭ 27 (-30.77%)
Mutual labels:  rq
Text2Video
WriteMyVideo's purpose is to help people create videos quickly and easily by simply typing out the video’s script and a description of images to include in the video.
Stars: ✭ 19 (-51.28%)
Mutual labels:  rq
flask-redis-docker
A minimal template for dockerized flask app with redis task queue
Stars: ✭ 49 (+25.64%)
Mutual labels:  rq
Rq
Simple job queues for Python
Stars: ✭ 8,065 (+20579.49%)
Mutual labels:  rq
FastAPI-Full-Stack-Samples
The API Application Development using Python FastAPI, including interactive API documentation
Stars: ✭ 61 (+56.41%)
Mutual labels:  rq
IncetOps
基于Inception,一个审计、执行、回滚、统计sql的开源系统
Stars: ✭ 46 (+17.95%)
Mutual labels:  rq-scheduler

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 >= 1.9
  • 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',
    	...
    ]
    
    
    
  2. 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 .

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].