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.2.tar.gz (2.6 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: django-pika-pubsub-0.2.tar.gz
  • Upload date:
  • Size: 2.6 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.2.tar.gz
Algorithm Hash digest
SHA256 dd08ed5de1283c3b79afbf7bf4d0991677059f96a8c00e0f9727149ecde11993
MD5 55a8bd3d651c5a23b9188ab62221a694
BLAKE2b-256 bae67700070cb48e28a55cddc08ed3f184548e20e3bd953ff98bb0be70528af2

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