Skip to main content

Start a RabbitMQ consumer after django server start.

Project description

=========================== Django RabbitMQ Integration

Start a RabbitMQ consumer after django server start.

Quick start

  1. Add "django-rabbitmq" to your INSTALLED_APPS setting like this::

    INSTALLED_APPS = [ ... 'django_rabbitmq', ]

  2. Config rabbitmq settings like this::

    RABBITMQ = { 'default': { 'HOST': 'server_ip', 'PORT': 5672, 'VIRTUAL_HOST': '/', 'USER': 'user', 'PASSWORD': 'password', 'QUEUE': 'queue' } }

  3. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

django-rabbitmq-0.1.3.tar.gz (4.0 kB view hashes)

Uploaded Source

Built Distribution

django_rabbitmq-0.1.3-py3-none-any.whl (5.1 kB view hashes)

Uploaded Python 3

Supported by

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