Skip to content

dima-kov/django-mq

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

django-mq

Installation

Install: pip install git+ssh://git@github.com/dima-kov/django-mq.git@master

Setup:

  1. Add mq to INSTALLED_APPS, make sure to place above django.contrib.admin to include functionality of queues in admin

  2. Set redis settings:

    MQ_REDIS_HOST = 'localhost'
    MQ_REDIS_PORT = 6379
    
  3. Set logging:

    MQ_LOGGING_DIRECTORY = '/tmp/project-mq-log/'
    MQ_LOGGING_LOGGERS = [
       'logger_foo',
       'logger_bar',
    ]
    from mq.logging import configure_logging
    
    configure_logging(LOGGING, MQ_LOGGING_LOGGERS, MQ_LOGGING_DIRECTORY)
    
  4. Set a class with queues facade. It is used for admin stats view: (/admin/mq/mqmessagetype/stats/).

    This class should be inherited from mq.queue.queue.BaseQueuesFacade:

    MQ_QUEUES_FACADE_CLASS = 'myapp.facade.QueuesFacade`
    

Settings

  • MQ_FLUSH_ERRORS_DAYS - specify days after which resolved MqErrors will be deleted with command mq_flush_errors

Django vs non django usage

App supports to be used with and without django.