A Django app to publish and consume rmq-messages via Pika.
Project description
Django-pika-pubsub is a simple Django app to publish and consume rmq-messages via Pika.
Quick start
Add “django_pika_pubsub” to your INSTALLED_APPS setting like this:
INSTALLED_APPS = [ ... 'django_pika_pubsub', ]
Add the following to your settings.py module:
PUBSUB = { 'RABBITMQ_USERNAME': os.getenv('RABBITMQ_USERNAME'), 'RABBITMQ_PASSWORD': os.getenv('RABBITMQ_PASSWORD'), 'RABBITMQ_HOST': os.getenv('RABBITMQ_HOST'), 'RABBITMQ_PORT': int(os.getenv('RABBITMQ_PORT')), }
Do following for producing messages:
from django_pika_pubsub import Producer ... producer = Producer.get_producer() producer.produce( exchange='orders', body={'id': order.id}, routing_key='order.sent.order_id.1.0.0' )
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-pika-pubsub-0.4.tar.gz
(3.7 kB
view hashes)