title: Django & Celery — Routing problems
body: <p>I'm using Django and Celery and I'm trying to setup routing to multiple queues. When I specify a task's <code>routing_key</code> and <code>exchange</code> (either in the task decorator or using <code>apply_async()</code>), the task isn't added to the broker (which is Kombu connecting to my MySQL database).</p>
  
  <p>If I specify the queue name in the task decorator (which will mean the routing key is ignored), the task works fine. It appears to be a problem with the routing/exchange setup.</p>
  
  <p>Any idea what the problem could be?</p>
  
  <p>Here's the setup:</p>
  
  <p><strong>settings.py</strong></p>
  
  <pre><code>INSTALLED_APPS = (
      ...
      'kombu.transport.django',
      'djcelery',
  )
  BROKER_BACKEND = 'django'
  CELERY_DEFAULT_QUEUE = 'default'
  CELERY_DEFAULT_EXCHANGE = "tasks"
  CELERY_DEFAULT_EXCHANGE_TYPE = "topic"
  CELERY_DEFAULT_ROUTING_KEY = "task.default"
  CELERY_QUEUES = {
      'default': {
          'binding_key':'task.#',
      },
      'i_tasks': {
          'binding_key':'important_task.#',
      },
  }
  </code></pre>
  
  <p><strong>tasks.py</strong></p>
  
  <pre><code>from celery.task import task
  
  @task(routing_key='important_task.update')
  def my_important_task():
      try:
          ...
      except Exception as exc:
          my_important_task.retry(exc=exc)
  </code></pre>
  
  <p><strong>Initiate task:</strong></p>
  
  <pre><code>from tasks import my_important_task
  my_important_task.delay()
  </code></pre>