Start a RabbitMQ consumer after django server start.
Project description
=========================== Django RabbitMQ Integration
Start a RabbitMQ consumer after django server start.
Quick start
-
Add "django-rabbitmq" to your INSTALLED_APPS setting like this::
INSTALLED_APPS = [ ... 'django_rabbitmq', ]
-
Config rabbitmq settings like this::
RABBITMQ = { 'default': { 'HOST': 'server_ip', 'PORT': 5672, 'VIRTUAL_HOST': '/', 'USER': 'user', 'PASSWORD': 'password', 'QUEUE': 'queue' } }
-
Create a mq.py and inherit RabbitMQ model::
from django_rabbitmq.mq import RabbitMQ
class CustomModel(RabbitMQ):
def callback(self, ch, method, properties, body): print("[django-rabbitmq] Received %r" % body) ...... your code ......
RabbitMQ.callback = CustomModel.callback
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
django-rabbitmq-0.1.3.tar.gz
(4.0 kB
view hashes)
Built Distribution
Close
Hashes for django_rabbitmq-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d81506706871aa4dc9bb6e1083e6f6ec2ae5c8cdd1d73b30c318999e0814e80c |
|
MD5 | 1a77b3281abc971a75957bb135e4f0ed |
|
BLAKE2b-256 | 8329c492f6b8b43a5b6c4f3808705436cf72d25f185e6eb3906e00eec213af8a |