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

Uploaded Source

File details

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

File metadata

  • Download URL: django-pika-pubsub-0.1.tar.gz
  • Upload date:
  • Size: 2.8 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.1.tar.gz
Algorithm Hash digest
SHA256 f378cc73ad5ef6dcc7b06af6cfe0842d762379bbe414d83d02f8279adc485d5c
MD5 c861cebcc28fbbb2716abac79924888a
BLAKE2b-256 c566e4718477248f6f7450fb98c4b6fedf96524ef2d03ca043ae3f22366454d1

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