Skip to main content

APScheduler for Django

Project description

Django APScheduler
==================
`APScheduler <https://github.com/agronholm/apscheduler>`_ for `Django <https://github.com/django/django>`_.

This little wrapper around APScheduler enables storing persistent jobs in the database using Django's ORM rather than requiring SQLAlchemy or some other bloatware.

Usage
-----

* Add ``django_apscheduler`` to ``INSTALLED_APPS`` in your Django project settings:
.. code-block:: python

INSTALLED_APPS = (
...
django_apscheduler,
)

* Run migrations:
.. code-block:: python

./manage.py migrate

* Instanciate a new scheduler as you would with APScheduler. For example:
.. code-block:: python

from apscheduler.schedulers.background import BackgroundScheduler

scheduler = BackgroundScheduler()

* Instruct the scheduler to use ``DjangoJobStore``:
.. code-block:: python

from django_apscheduler.jobstores import DjangoJobStore

# If you want all scheduled jobs to use this store by default,
# use the name 'default' instead of 'djangojobstore'.
scheduler.add_jobstore(DjangoJobStore(), 'djangojobstore')

* Register any jobs as you would normally. Note that if you haven't set ``DjangoJobStore`` as the ``'default'`` job store, you'll need to include ``jobstore='djangojobstore'`` in your ``scheduler.add_job`` calls.

* Start the scheduler:
.. code-block:: python

scheduler.start()

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

django_apscheduler-0.1.tar.gz (5.3 kB view details)

Uploaded Source

File details

Details for the file django_apscheduler-0.1.tar.gz.

File metadata

File hashes

Hashes for django_apscheduler-0.1.tar.gz
Algorithm Hash digest
SHA256 87069533d45c655ef4666f5eac192ea30639b9129e3d60dea5aff1eb5b94c4df
MD5 76e86135bf807f8f615beb014e633b71
BLAKE2b-256 ace0f95b78673e83babeb55b378e06d5981f67a81d38d1fb3a8dd43394006941

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page