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 details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

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

Uploaded Python 3

File details

Details for the file django-rabbitmq-0.1.3.tar.gz.

File metadata

  • Download URL: django-rabbitmq-0.1.3.tar.gz
  • Upload date:
  • Size: 4.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.0.post20201103 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5

File hashes

Hashes for django-rabbitmq-0.1.3.tar.gz
Algorithm Hash digest
SHA256 3ed9de16102ef084ed8809b377854d937e22eeeacfe9da367145bba941459b2f
MD5 6f2a187e53b92439614fe6d9e76e2aea
BLAKE2b-256 3d88096b32ba08080d9232e145211635f6743277a9e5b5d45c5f1908ed1faf07

See more details on using hashes here.

File details

Details for the file django_rabbitmq-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: django_rabbitmq-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 5.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/50.3.0.post20201103 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5

File hashes

Hashes for django_rabbitmq-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d81506706871aa4dc9bb6e1083e6f6ec2ae5c8cdd1d73b30c318999e0814e80c
MD5 1a77b3281abc971a75957bb135e4f0ed
BLAKE2b-256 8329c492f6b8b43a5b6c4f3808705436cf72d25f185e6eb3906e00eec213af8a

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