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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django-rabbitmq-0.1.3.tar.gz.
File metadata
- Download URL: django-rabbitmq-0.1.3.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.0.post20201103 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3ed9de16102ef084ed8809b377854d937e22eeeacfe9da367145bba941459b2f
|
|
| MD5 |
6f2a187e53b92439614fe6d9e76e2aea
|
|
| BLAKE2b-256 |
3d88096b32ba08080d9232e145211635f6743277a9e5b5d45c5f1908ed1faf07
|
File details
Details for the file django_rabbitmq-0.1.3-py3-none-any.whl.
File metadata
- Download URL: django_rabbitmq-0.1.3-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.0.post20201103 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d81506706871aa4dc9bb6e1083e6f6ec2ae5c8cdd1d73b30c318999e0814e80c
|
|
| MD5 |
1a77b3281abc971a75957bb135e4f0ed
|
|
| BLAKE2b-256 |
8329c492f6b8b43a5b6c4f3808705436cf72d25f185e6eb3906e00eec213af8a
|