Skip to main content

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

  1. Add “django_pika_pubsub” to your INSTALLED_APPS setting like this:

    INSTALLED_APPS = [
        ...
        'django_pika_pubsub',
    ]
  2. 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')),
    }
  3. 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 details)

Uploaded Source

File details

Details for the file django-pika-pubsub-0.4.tar.gz.

File metadata

  • Download URL: django-pika-pubsub-0.4.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.8.0

File hashes

Hashes for django-pika-pubsub-0.4.tar.gz
Algorithm Hash digest
SHA256 5387251d0fa43964e35eaeb1451780f9c652d291f170adbac7c271b17bae13f3
MD5 a7ad5252f018589a8c06f508f4fd4d00
BLAKE2b-256 00510106bed8d3e466d72e03fbb2631199c6571d81608910b7e99c419da25319

See more details on using hashes here.

Supported by

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