Skip to main content

``pq`` wrapper for django

Project description

pq wrapper for django.

https://travis-ci.org/jeanphix/dj-pq.svg?branch=master

Installation

pip install dj-pq

Configuration

Add dj_pq to your INSTALLED_APPS:

INSTALLED_APPS += [
    'dj_pq',
]

Apply migrations:

./manage.py migrate

Usage

dj-pq exposes the pq tasks API.

from dj_pq import get_queue

queue = get_queue('notifications')

@queue.task()
def notify(user_id):
    User.objects.get(id=user_id).notify()

notify(42)

Optionally a Queue can be bound to a specific database connection:

queue = get_queue('notifications', 'another_connection')

A worker command allows to start a worker for a given queue:

./manage.py worker notifications

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

dj-pq-1.4.1.tar.gz (3.2 kB view details)

Uploaded Source

File details

Details for the file dj-pq-1.4.1.tar.gz.

File metadata

  • Download URL: dj-pq-1.4.1.tar.gz
  • Upload date:
  • Size: 3.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for dj-pq-1.4.1.tar.gz
Algorithm Hash digest
SHA256 67ee8c563795255d19f1720414d72887c493bedcc3633eed7fbe1cc413af2a47
MD5 626781c591945fa84dd67e00b0d32282
BLAKE2b-256 17d9bd1c4c89c41a01e3ef90a1b5fed5f9f6bcd57a68dfc626e2bb3ed76603c7

See more details on using hashes here.

Supported by

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