``pq`` wrapper for django
Project description
pq wrapper for django.
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
Release history Release notifications | RSS feed
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.2.tar.gz
(3.2 kB
view details)
File details
Details for the file dj-pq-1.4.2.tar.gz
.
File metadata
- Download URL: dj-pq-1.4.2.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d14f7e6d2f3661a38bd3539d0b45dea77a047e6990a7ee2d6f205f5f4c562aed |
|
MD5 | f72c494ebfac185003f589d239c9dd2d |
|
BLAKE2b-256 | 4b46f71d4762a3153a689c88ac7a153c8ba4e265409aee4ab0c70027ceb0b19b |